# lang情報のついた全文索引のテスト(scalar, あとづけ)

Begin;
Initialize;
InitializeSession "DefaultDB";

# 表を作成
Command "create table T (N int, C ntext, L language)";

#insert
CreatePreparedCommand "ins" "insert into T (N, C, L) values (?, ?, ?)";
PreparedCommand "ins" [0, null, "ja+en"];
PreparedCommand "ins" [1, textucsfile "..\\..\\doc\\takekurabe.txt", "ja+en"];
ErasePreparedCommand "ins";

#どのタプルも取れないことを期待
Command "select N from T where C like ?" ["%ペイジ%"]; # 「ページ」の異表記
Command "select N from T where C like ?" ["%improve%"]; # 「improving」の原形

# 索引作成
Command "create fulltext index FTIndex on T(C) language column L hint 'inverted=(normalized=true, indexing=dual, tokenizer=DUAL:JAP:ALL:1 @NORMRSCID:1 @UNARSCID:1)'";

#タプル[1]が取れることを期待
Command "select N, from T where C like ?" ["%ペイジ%"]; # 「ページ」の異表記
Command "select N, from T where C like ?" ["%improve%"]; # 「improving」の原形

Command "verify index FTIndex cascade continue";

# 全文ファイルテスト用の表を消去
Command "drop table T";

TerminateSession;
Terminate;
End;

