# contains述語にsynonym関数

Begin;
Initialize;
InitializeSession "TEST";
Command "create database TEST";
Command "create table T (ID int, F nvarchar(256))";
Command "create fulltext index T_F on T(F) hint 'inverted=(indexing=dual, tokenizer=DUAL:JAP:ALL:1 @UNARSCID:1 @NORMRSCID:1)'";

Command "insert into T values (1, 'aaa aaa aac aad')";
Command "insert into T values (2, 'aaa aab aaa aad')";
Command "insert into T values (3, 'aaa aab aac aaa')";
Command "insert into T values (4, 'aaa aab aac aad')";

Command "select ID, score(F) from T where F contains 'aaa'";
Command "select ID, score(F) from T where F contains synonym('aaa' 'aad')";
Command "select ID, score(F) from T where F contains 'aaa' | 'aad'";

Command "select ID from T where F contains within(synonym('aaa' 'aab') 'aaa' symmetric upper 2)";
Command "select ID from T where F contains within(wordhead('aa') 'aac' symmetric upper 3)";
Command "select ID from T where F contains within(wordtail('aa') 'aac' symmetric upper 2)";
Command "select ID from T where F contains within(string('aa') 'aac' symmetric upper 3)";

Command "drop table T";
Command "drop database TEST";
TerminateSession;
Terminate;
End;
