blob: 87de1fb3117648797cb27bb3ba441af384a9e063 [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 with ~= using edit-distance on strings.
3 * The index should be applied.
4 * Success : Yes
5 */
6
7drop dataverse test if exists;
8create dataverse test;
9use dataverse test;
10
11create type DBLPType as closed {
12 id: int32,
13 dblpid: string,
14 title: string,
15 authors: string,
16 misc: string
17}
18
19create dataset DBLP(DBLPType) partitioned by key id;
20
21load dataset DBLP
22using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
23(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
24
25create index ngram_index on DBLP(authors) type ngram(3);
26
27write output to nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-edit-distance.adm";
28
29set simfunction 'edit-distance';
30set simthreshold '1';
31
32for $o in dataset('DBLP')
33where $o.authors ~= "Amihay Motro"
34return $o