vinayakb | 5ee049d | 2013-04-06 21:21:29 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Description : Tests whether an ngram_index is applied to optimize a selection query with ~= using Jaccard on 3-gram tokens. |
| 3 | * The index should be applied. |
| 4 | * Success : Yes |
| 5 | */ |
| 6 | |
| 7 | drop dataverse test if exists; |
| 8 | create dataverse test; |
| 9 | use dataverse test; |
| 10 | |
| 11 | create type DBLPType as closed { |
| 12 | id: int32, |
| 13 | dblpid: string, |
| 14 | title: string, |
| 15 | authors: string, |
| 16 | misc: string |
| 17 | } |
| 18 | |
| 19 | create dataset DBLP(DBLPType) primary key id; |
| 20 | |
| 21 | create index ngram_index on DBLP(title) type ngram(3); |
| 22 | |
| 23 | write output to nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-jaccard.adm"; |
| 24 | |
| 25 | set simfunction 'jaccard'; |
| 26 | set simthreshold '0.8f'; |
| 27 | |
| 28 | for $o in dataset('DBLP') |
| 29 | where gram-tokens($o.title, 3, false) ~= gram-tokens("Transactions for Cooperative Environments", 3, false) |
| 30 | return $o |