blob: 9412cf3a228113d496dc0ac3ec7feaf9d9613078 [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 edit-distance function on strings.
3 * The index should *not* be applied (see below).
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
alexander.behmc576c602012-07-06 02:41:15 +000021create index ngram_index on DBLP(authors) type ngram(3);
22
23write output to nc1:"rttest/inverted-index-basic_ngram-edit-distance-panic.adm";
24
25// This query cannot be optimized with an index, based on the high edit distance.
26for $o in dataset('DBLP')
27where edit-distance($o.authors, "Amihay Motro") <= 5
28return $o