blob: b11629fbc2f302af02df54fe01a61b617e8e9aa0 [file] [log] [blame]
alexander.behmc576c602012-07-06 02:41:15 +00001/*
2 * Description : Tests whether an ngram_index is applied to optimize a selection query using the similarity-jaccard function on 3-gram tokens.
3 * The index should be applied.
4 * Success : Yes
5 */
6
7drop dataverse test if exists;
8create dataverse test;
9use dataverse test;
ramangrover29a3211202013-05-19 11:56:49 -070010set import-private-functions 'true';
alexander.behmc576c602012-07-06 02:41:15 +000011
12create type DBLPType as closed {
13 id: int32,
14 dblpid: string,
15 title: string,
16 authors: string,
17 misc: string
18}
19
ramangrover29669d8f62013-02-11 06:03:32 +000020create dataset DBLP(DBLPType) primary key id;
alexander.behmc576c602012-07-06 02:41:15 +000021
alexander.behmc576c602012-07-06 02:41:15 +000022create index ngram_index on DBLP(title) type ngram(3);
23
24write output to nc1:"rttest/inverted-index-basic_ngram-jaccard.adm";
25
26for $o in dataset('DBLP')
27where similarity-jaccard(gram-tokens($o.title, 3, false), gram-tokens("Transactions for Cooperative Environments", 3, false)) >= 0.5f
28return $o