-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmkindex.js
27 lines (20 loc) · 1.09 KB
/
mkindex.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var Sql=require("rampart-sql");
var sql=new Sql.init(process.scriptPath + "/web_server/data/wikipedia_search");
/*
This statement creates the full text index on the Doc field.
WITH WORDEXPRESSIONS:
see: https://docs.thunderstone.com/site/texisman/index_options.html
and https://docs.thunderstone.com/site/texisman/creating_a_metamorph_index.html
see also "addexp", which is the same as "WITH WORDEXPRESSIONS"
but in a separate statement: https://docs.thunderstone.com/site/texisman/indexing_properties.html
the regular expressions used to define a word are not perlRE. It is thunderstone's own rex:
https://docs.thunderstone.com/site/texisman/rex_expression_syntax.html
"metamorph inverted index" can also be replaced with "FULLTEXT"
see: https://docs.thunderstone.com/site/vortexman/create_index_with_options.html
INDEXMETER prints the progress of the index creation.
*/
sql.exec(
"create metamorph inverted index wikitext_Doc_mmix on wikitext(Doc) "+
"WITH WORDEXPRESSIONS "+
"('[\\alnum\\x80-\\xFF]{2,99}', '[\\alnum\\$%@\\-_\\+]{2,99}') "+
"INDEXMETER 'on'");