blob: fb59040c844b675d064ff8038e4f934f7428c038 [file] [log] [blame]
vinayakb5ee049d2013-04-06 21:21:29 +00001/*
2 * Description : Tests whether an ngram_index is applied to optimize a selection query using the similarity-jaccard-check function on 3-gram tokens.
3 * Tests that the optimizer rule correctly drills through the let clauses.
4 * The index should be applied.
5 * Success : Yes
6 */
7
8drop dataverse test if exists;
9create dataverse test;
10use dataverse test;
11
12create type DBLPType as closed {
13 id: int32,
14 dblpid: string,
15 title: string,
16 authors: string,
17 misc: string
18}
19
20create dataset DBLP(DBLPType) primary key id;
21
22create index ngram_index on DBLP(title) type ngram(3);
23
24write output to nc1:"rttest/inverted-index-complex_ngram-jaccard-check-let.adm";
25
26for $o in dataset('DBLP')
27let $jacc := similarity-jaccard-check(gram-tokens($o.title, 3, false), gram-tokens("Transactions for Cooperative Environments", 3, false), 0.5f)
28where $jacc[0]
29return $o