Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/spell/CleanIndexWriter.java |
— | — | @@ -158,9 +158,9 @@ |
159 | 159 | /** Add title/redirect with ranks information only */ |
160 | 160 | protected void addTitleOnly(Article article) { |
161 | 161 | Document doc = new Document(); |
162 | | - doc.add(new Field("key",article.getIndexKey(),Store.NO,Index.UN_TOKENIZED)); |
163 | | - doc.add(new Field("ns_title",article.getTitle(),Store.YES,Index.TOKENIZED)); |
164 | | - doc.add(new Field("ns_namespace",article.getNamespace(),Store.YES,Index.UN_TOKENIZED)); |
| 162 | + doc.add(new Field("key",article.getIndexKey(),Store.NO,Index.NOT_ANALYZED)); |
| 163 | + doc.add(new Field("ns_title",article.getTitle(),Store.YES,Index.ANALYZED)); |
| 164 | + doc.add(new Field("ns_namespace",article.getNamespace(),Store.YES,Index.NOT_ANALYZED)); |
165 | 165 | doc.add(new Field("ns_rank",Integer.toString(article.getReferences()),Store.YES,Index.NO)); |
166 | 166 | if(article.isRedirect()) |
167 | 167 | doc.add(new Field("ns_redirect",article.getRedirectTarget(),Store.YES,Index.NO)); |
— | — | @@ -202,7 +202,7 @@ |
203 | 203 | sb.append(val); |
204 | 204 | } |
205 | 205 | Document doc = new Document(); |
206 | | - doc.add(new Field("metadata_key",key, Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 206 | + doc.add(new Field("metadata_key",key, Field.Store.YES, Field.Index.NOT_ANALYZED)); |
207 | 207 | doc.add(new Field("metadata_value",sb.toString(), Field.Store.YES, Field.Index.NO)); |
208 | 208 | |
209 | 209 | try { |
Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/spell/api/NgramIndexer.java |
— | — | @@ -246,8 +246,8 @@ |
247 | 247 | for(int j=0 ; j<ngrams.length ; j++){ |
248 | 248 | String ngram = ngrams[j]; |
249 | 249 | if(j==0) |
250 | | - doc.add(new Field(startField+i, ngram, Field.Store.NO, Field.Index.UN_TOKENIZED)); |
251 | | - doc.add(new Field(field, ngram, Field.Store.NO, Field.Index.UN_TOKENIZED)); |
| 250 | + doc.add(new Field(startField+i, ngram, Field.Store.NO, Field.Index.NOT_ANALYZED)); |
| 251 | + doc.add(new Field(field, ngram, Field.Store.NO, Field.Index.NOT_ANALYZED)); |
252 | 252 | } |
253 | 253 | } |
254 | 254 | } |
Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/spell/api/TitleNgramIndexer.java |
— | — | @@ -97,9 +97,9 @@ |
98 | 98 | |
99 | 99 | Document doc = new Document(); |
100 | 100 | // pageId is primary key |
101 | | - doc.add(new Field("pageid", pageId, Field.Store.NO, Field.Index.UN_TOKENIZED)); |
| 101 | + doc.add(new Field("pageid", pageId, Field.Store.NO, Field.Index.NOT_ANALYZED)); |
102 | 102 | if(!ns.equals("0")) |
103 | | - doc.add(new Field("namespace", ns, Field.Store.NO, Field.Index.UN_TOKENIZED)); |
| 103 | + doc.add(new Field("namespace", ns, Field.Store.NO, Field.Index.NOT_ANALYZED)); |
104 | 104 | doc.add(new Field("key", ns+":"+title, Field.Store.YES, Field.Index.NO)); |
105 | 105 | doc.add(new Field(field, decomposed, Field.Store.YES, Field.Index.NO)); |
106 | 106 | if(redirectTo != null) |
Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/spell/api/SpellCheckIndexer.java |
— | — | @@ -299,9 +299,9 @@ |
300 | 300 | String normalized = FastWikiTokenizerEngine.normalize(title.toLowerCase()); |
301 | 301 | String decomposed = FastWikiTokenizerEngine.decompose(normalized); |
302 | 302 | // doc.add(new Field("title", ns+":"+title, Field.Store.YES, Field.Index.NO)); |
303 | | - doc.add(new Field("title", normalized, Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 303 | + doc.add(new Field("title", normalized, Field.Store.YES, Field.Index.NOT_ANALYZED)); |
304 | 304 | if(decomposed != normalized) |
305 | | - doc.add(new Field("title", decomposed, Field.Store.NO, Field.Index.UN_TOKENIZED)); |
| 305 | + doc.add(new Field("title", decomposed, Field.Store.NO, Field.Index.NOT_ANALYZED)); |
306 | 306 | doc.add(new Field("rank", rank, Field.Store.YES, Field.Index.NO)); |
307 | 307 | if(redirect!=null){ |
308 | 308 | String redirectNormalized = FastWikiTokenizerEngine.normalize(redirect.substring(redirect.indexOf(':')+1).toLowerCase()); |
— | — | @@ -320,10 +320,10 @@ |
321 | 321 | String normalized = FastWikiTokenizerEngine.normalize(title.toLowerCase()); |
322 | 322 | String decomposed = FastWikiTokenizerEngine.decompose(normalized); |
323 | 323 | //doc.add(new Field("ns_title", ns+":"+title, Field.Store.YES, Field.Index.NO)); |
324 | | - doc.add(new Field("ns_title", ns+":"+normalized, Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 324 | + doc.add(new Field("ns_title", ns+":"+normalized, Field.Store.YES, Field.Index.NOT_ANALYZED)); |
325 | 325 | if(decomposed != normalized) |
326 | | - doc.add(new Field("ns_title", ns+":"+decomposed, Field.Store.NO, Field.Index.UN_TOKENIZED)); |
327 | | - doc.add(new Field("ns_namespace", ns, Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 326 | + doc.add(new Field("ns_title", ns+":"+decomposed, Field.Store.NO, Field.Index.NOT_ANALYZED)); |
| 327 | + doc.add(new Field("ns_namespace", ns, Field.Store.YES, Field.Index.NOT_ANALYZED)); |
328 | 328 | doc.add(new Field("ns_rank", rank, Field.Store.YES, Field.Index.NO)); |
329 | 329 | if(redirect!=null && redirect.substring(0,redirect.indexOf(':')).equals(ns)){ |
330 | 330 | String redirectNormalized = FastWikiTokenizerEngine.normalize(redirect.substring(redirect.indexOf(':')+1).toLowerCase()); |
— | — | @@ -374,13 +374,13 @@ |
375 | 375 | HashMap<String,SimpleInt> freq = getFrequencies(phrase,ir); |
376 | 376 | |
377 | 377 | Document doc = new Document(); |
378 | | - doc.add(new Field("ns_phrase", phrase, Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 378 | + doc.add(new Field("ns_phrase", phrase, Field.Store.YES, Field.Index.NOT_ANALYZED)); |
379 | 379 | doc.add(new Field("ns_namespace", new StringTokenStream(freq.keySet()))); |
380 | 380 | for(Entry<String,SimpleInt> e : freq.entrySet()){ |
381 | 381 | doc.add(new Field("ns_freq_"+e.getKey(), Integer.toString(e.getValue().count), Field.Store.YES, Field.Index.NO)); |
382 | 382 | } |
383 | 383 | if(inTitle){ |
384 | | - doc.add(new Field("ns_intitle","1", Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 384 | + doc.add(new Field("ns_intitle","1", Field.Store.YES, Field.Index.NOT_ANALYZED)); |
385 | 385 | } |
386 | 386 | setOmitNorms(doc); |
387 | 387 | ngramWriter.addDocument(doc); |
— | — | @@ -397,9 +397,9 @@ |
398 | 398 | Document doc = new Document(); |
399 | 399 | String decomposed = FastWikiTokenizerEngine.decompose(word); |
400 | 400 | ngramWriter.createNgramFields(doc,"ns_word",decomposed,NgramIndexer.Type.WORDS); |
401 | | - doc.add(new Field("ns_word",word, Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 401 | + doc.add(new Field("ns_word",word, Field.Store.YES, Field.Index.NOT_ANALYZED)); |
402 | 402 | if(decomposed != word) |
403 | | - doc.add(new Field("ns_word",decomposed, Field.Store.NO, Field.Index.UN_TOKENIZED)); |
| 403 | + doc.add(new Field("ns_word",decomposed, Field.Store.NO, Field.Index.NOT_ANALYZED)); |
404 | 404 | for(Entry<String,SimpleInt> e : freq.entrySet()) |
405 | 405 | doc.add(new Field("ns_freq_"+e.getKey(), Integer.toString(e.getValue().count), Field.Store.YES, Field.Index.NO)); |
406 | 406 | doc.add(new Field("ns_freq",Integer.toString(freqSum),Field.Store.YES, Field.Index.NO)); |
— | — | @@ -424,10 +424,10 @@ |
425 | 425 | } |
426 | 426 | Document doc = new Document(); |
427 | 427 | //ngramWriter.createNgramFields(doc,"phrase",phrase); |
428 | | - doc.add(new Field("phrase",phrase, Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 428 | + doc.add(new Field("phrase",phrase, Field.Store.YES, Field.Index.NOT_ANALYZED)); |
429 | 429 | doc.add(new Field("freq",Integer.toString(freq), Field.Store.YES, Field.Index.NO)); |
430 | 430 | if(inTitle){ |
431 | | - doc.add(new Field("intitle","1", Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 431 | + doc.add(new Field("intitle","1", Field.Store.YES, Field.Index.NOT_ANALYZED)); |
432 | 432 | } |
433 | 433 | if(corrected != null){ |
434 | 434 | doc.add(new Field("misspell",corrected, Field.Store.YES, Field.Index.NO)); |
— | — | @@ -451,7 +451,7 @@ |
452 | 452 | sb.append(val); |
453 | 453 | } |
454 | 454 | Document doc = new Document(); |
455 | | - doc.add(new Field("metadata_key",key, Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 455 | + doc.add(new Field("metadata_key",key, Field.Store.YES, Field.Index.NOT_ANALYZED)); |
456 | 456 | doc.add(new Field("metadata_value",sb.toString(), Field.Store.YES, Field.Index.NO)); |
457 | 457 | |
458 | 458 | setOmitNorms(doc); |
— | — | @@ -470,9 +470,9 @@ |
471 | 471 | Document doc = new Document(); |
472 | 472 | String decomposed = FastWikiTokenizerEngine.decompose(word); |
473 | 473 | ngramWriter.createNgramFields(doc,"word",decomposed,NgramIndexer.Type.WORDS); |
474 | | - doc.add(new Field("word",word, Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 474 | + doc.add(new Field("word",word, Field.Store.YES, Field.Index.NOT_ANALYZED)); |
475 | 475 | if(decomposed != word) |
476 | | - doc.add(new Field("word",decomposed, Field.Store.NO, Field.Index.UN_TOKENIZED)); |
| 476 | + doc.add(new Field("word",decomposed, Field.Store.NO, Field.Index.NOT_ANALYZED)); |
477 | 477 | doc.add(new Field("freq",Integer.toString(freq), Field.Store.YES, Field.Index.NO)); |
478 | 478 | doc.add(new Field("meta1",dmeta.doubleMetaphone(decomposed), Field.Store.YES, Field.Index.NO)); |
479 | 479 | doc.add(new Field("meta2",dmeta.doubleMetaphone(decomposed,true), Field.Store.YES, Field.Index.NO)); |
— | — | @@ -485,7 +485,7 @@ |
486 | 486 | if(context == null) |
487 | 487 | return; |
488 | 488 | Document doc = new Document(); |
489 | | - doc.add(new Field("context_key",key, Field.Store.NO, Field.Index.UN_TOKENIZED)); |
| 489 | + doc.add(new Field("context_key",key, Field.Store.NO, Field.Index.NOT_ANALYZED)); |
490 | 490 | doc.add(new Field("context", context, Field.Store.YES, Field.Index.NO)); |
491 | 491 | setOmitNorms(doc); |
492 | 492 | ngramWriter.addDocument(doc); |
Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/prefix/PrefixIndexBuilder.java |
— | — | @@ -245,7 +245,7 @@ |
246 | 246 | } |
247 | 247 | } |
248 | 248 | Document d = new Document(); |
249 | | - d.add(new Field("prefix",prefix,Field.Store.NO,Field.Index.NO_NORMS)); |
| 249 | + d.add(new Field("prefix",prefix,Field.Store.NO,Field.Index.NOT_ANALYZED_NO_NORMS)); |
250 | 250 | d.add(new Field("articles",new StringList(selected).toString(),Field.Store.YES,Field.Index.NO)); |
251 | 251 | setOmitNorms(d); |
252 | 252 | writer.addDocument(d); |
— | — | @@ -268,7 +268,7 @@ |
269 | 269 | d.add(new Field("article",serialize(key,ref,redirect),Field.Store.YES,Field.Index.NO)); |
270 | 270 | ArrayList<Token> canonized = canonize(key,iid,filters); |
271 | 271 | for(Token t : canonized){ |
272 | | - d.add(new Field("key",t.termText(),Field.Store.NO,Field.Index.TOKENIZED)); |
| 272 | + d.add(new Field("key",t.termText(),Field.Store.NO,Field.Index.ANALYZED)); |
273 | 273 | } |
274 | 274 | setOmitNorms(d); |
275 | 275 | writer.addDocument(d); |
— | — | @@ -387,11 +387,11 @@ |
388 | 388 | return; // ignore redirects like byzantine -> byzantine empire |
389 | 389 | // add to index |
390 | 390 | Document d = new Document(); |
391 | | - d.add(new Field("pageid",pageId,Field.Store.NO,Field.Index.UN_TOKENIZED)); |
392 | | - d.add(new Field("key",key,Field.Store.YES,Field.Index.UN_TOKENIZED)); |
| 391 | + d.add(new Field("pageid",pageId,Field.Store.NO,Field.Index.NOT_ANALYZED)); |
| 392 | + d.add(new Field("key",key,Field.Store.YES,Field.Index.NOT_ANALYZED)); |
393 | 393 | ArrayList<Token> canonized = canonize(key,iid,filters); |
394 | 394 | for(Token t : canonized){ |
395 | | - d.add(new Field("key",t.termText(),Field.Store.NO,Field.Index.TOKENIZED)); |
| 395 | + d.add(new Field("key",t.termText(),Field.Store.NO,Field.Index.ANALYZED)); |
396 | 396 | } |
397 | 397 | if(redirect!=null && !redirect.equals("")){ // redirect target and its rank |
398 | 398 | d.add(new Field("redirect",redirect,Field.Store.YES,Field.Index.NO)); |
Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/storage/RelatedStorage.java |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | ensureWrite(); |
36 | 36 | StringList sl = new StringList(CompactRelated.convertToStringList(rel)); |
37 | 37 | Document doc = new Document(); |
38 | | - doc.add(new Field("key",key,Field.Store.YES,Field.Index.UN_TOKENIZED)); |
| 38 | + doc.add(new Field("key",key,Field.Store.YES,Field.Index.NOT_ANALYZED)); |
39 | 39 | doc.add(new Field("related",sl.toString(),Field.Store.COMPRESS,Field.Index.NO)); |
40 | 40 | writer.addDocument(doc); |
41 | 41 | } |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | ensureWrite(); |
45 | 45 | StringList sl = new StringList(Related.convertToStringList(rel)); |
46 | 46 | Document doc = new Document(); |
47 | | - doc.add(new Field("key",key,Field.Store.YES,Field.Index.UN_TOKENIZED)); |
| 47 | + doc.add(new Field("key",key,Field.Store.YES,Field.Index.NOT_ANALYZED)); |
48 | 48 | doc.add(new Field("related",sl.toString(),Field.Store.COMPRESS,Field.Index.NO)); |
49 | 49 | writer.addDocument(doc); |
50 | 50 | } |
Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/index/WikiIndexModifier.java |
— | — | @@ -682,10 +682,10 @@ |
683 | 683 | NamespaceFilter contentNamespaces = iid.getContentNamespaces(); |
684 | 684 | |
685 | 685 | // page_id from database, used to look up and replace entries on index updates |
686 | | - doc.add(new Field("key", article.getIndexKey(), Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 686 | + doc.add(new Field("key", article.getIndexKey(), Field.Store.YES, Field.Index.NOT_ANALYZED)); |
687 | 687 | |
688 | 688 | // namespace, returned with results |
689 | | - doc.add(new Field("namespace", article.getNamespace(), Field.Store.YES, Field.Index.UN_TOKENIZED)); |
| 689 | + doc.add(new Field("namespace", article.getNamespace(), Field.Store.YES, Field.Index.NOT_ANALYZED)); |
690 | 690 | |
691 | 691 | // raw rank value |
692 | 692 | doc.add(new Field("rank",Integer.toString(article.getRank()), |
— | — | @@ -694,7 +694,7 @@ |
695 | 695 | // redirect namespace |
696 | 696 | if(article.isRedirect()){ |
697 | 697 | doc.add(new Field("redirect_namespace",Integer.toString(article.getRedirectTargetNamespace()), |
698 | | - Field.Store.NO, Field.Index.UN_TOKENIZED)); |
| 698 | + Field.Store.NO, Field.Index.NOT_ANALYZED)); |
699 | 699 | } |
700 | 700 | |
701 | 701 | if(contentNamespaces.contains(article.getNamespace())){ |
— | — | @@ -710,7 +710,7 @@ |
711 | 711 | float rankBoost = transformRank(article.getRank()); |
712 | 712 | |
713 | 713 | // prefix title for prefix: searches |
714 | | - Field prefix = new Field("prefix", article.getNsTitleKey().toLowerCase(), Field.Store.NO, Field.Index.UN_TOKENIZED); |
| 714 | + Field prefix = new Field("prefix", article.getNsTitleKey().toLowerCase(), Field.Store.NO, Field.Index.NOT_ANALYZED); |
715 | 715 | prefix.setBoost(rankBoost); |
716 | 716 | doc.add(prefix); |
717 | 717 | |
— | — | @@ -737,7 +737,7 @@ |
738 | 738 | tokenizer.tokenize(); |
739 | 739 | |
740 | 740 | // title |
741 | | - Field title = new Field(fields.title(), article.getTitle(), Field.Store.YES, Field.Index.TOKENIZED); |
| 741 | + Field title = new Field(fields.title(), article.getTitle(), Field.Store.YES, Field.Index.ANALYZED); |
742 | 742 | title.setBoost(rankBoost); |
743 | 743 | doc.add(title); |
744 | 744 | |
— | — | @@ -766,7 +766,7 @@ |
767 | 767 | } |
768 | 768 | |
769 | 769 | // reverse title for wildcard searches |
770 | | - Field rtitle = new Field(fields.reverse_title(), StringUtils.reverseString(article.getTitle()), Field.Store.NO, Field.Index.TOKENIZED); |
| 770 | + Field rtitle = new Field(fields.reverse_title(), StringUtils.reverseString(article.getTitle()), Field.Store.NO, Field.Index.ANALYZED); |
771 | 771 | rtitle.setBoost(rankBoost); |
772 | 772 | doc.add(rtitle); |
773 | 773 | |
— | — | @@ -775,7 +775,7 @@ |
776 | 776 | while (e.hasMoreElements()) { |
777 | 777 | String key = (String)e.nextElement(); |
778 | 778 | String value = article.DiscussionThreadingInfo.get(key); |
779 | | - doc.add( new Field( key, value, Store.YES, Index.UN_TOKENIZED) ); |
| 779 | + doc.add( new Field( key, value, Store.YES, Index.NOT_ANALYZED) ); |
780 | 780 | } |
781 | 781 | |
782 | 782 | // extra info (for spellcheck indexes) |
— | — | @@ -819,8 +819,8 @@ |
820 | 820 | SimpleDateFormat isoDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); |
821 | 821 | isoDate.setTimeZone(TimeZone.getTimeZone("GMT")); |
822 | 822 | Document doc = new Document(); |
823 | | - doc.add(new Field("pageid",article.getPageIdStr(),Store.NO,Index.UN_TOKENIZED)); |
824 | | - doc.add(new Field("key",key,Store.NO,Index.UN_TOKENIZED)); |
| 823 | + doc.add(new Field("pageid",article.getPageIdStr(),Store.NO,Index.NOT_ANALYZED)); |
| 824 | + doc.add(new Field("key",key,Store.NO,Index.NOT_ANALYZED)); |
825 | 825 | for(FieldBuilder.BuilderSet bs : builder.getBuilders()){ |
826 | 826 | FieldNameFactory fields = bs.getFields(); |
827 | 827 | FilterFactory filters = bs.getFilters(); |
— | — | @@ -845,15 +845,15 @@ |
846 | 846 | float rankBoost = transformRank(article.getRank()); |
847 | 847 | Document doc = new Document(); |
848 | 848 | log.debug("Adding interwiki title pageid="+suffix+":"+article.getPageIdStr()+", key="+suffix+":"+key); |
849 | | - doc.add(new Field("pageid",suffix+":"+article.getPageIdStr(),Store.NO,Index.UN_TOKENIZED)); |
850 | | - doc.add(new Field("key",suffix+":"+key,Store.NO,Index.UN_TOKENIZED)); |
851 | | - doc.add(new Field("suffix",suffix,Store.YES,Index.UN_TOKENIZED)); |
852 | | - doc.add(new Field("dbname",dbname,Store.NO,Index.UN_TOKENIZED)); |
853 | | - doc.add(new Field("namespace",article.getNamespace(),Store.YES,Index.UN_TOKENIZED)); |
| 849 | + doc.add(new Field("pageid",suffix+":"+article.getPageIdStr(),Store.NO,Index.NOT_ANALYZED)); |
| 850 | + doc.add(new Field("key",suffix+":"+key,Store.NO,Index.NOT_ANALYZED)); |
| 851 | + doc.add(new Field("suffix",suffix,Store.YES,Index.NOT_ANALYZED)); |
| 852 | + doc.add(new Field("dbname",dbname,Store.NO,Index.NOT_ANALYZED)); |
| 853 | + doc.add(new Field("namespace",article.getNamespace(),Store.YES,Index.NOT_ANALYZED)); |
854 | 854 | // redirect namespace |
855 | 855 | if(article.isRedirect()){ |
856 | 856 | doc.add(new Field("redirect_namespace",Integer.toString(article.getRedirectTargetNamespace()), |
857 | | - Field.Store.NO, Field.Index.UN_TOKENIZED)); |
| 857 | + Field.Store.NO, Field.Index.NOT_ANALYZED)); |
858 | 858 | } |
859 | 859 | Field title = new Field("title",article.getTitle(),Store.YES, Index.NO); |
860 | 860 | title.setBoost(rankBoost); |
Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/ranks/Links.java |
— | — | @@ -361,16 +361,16 @@ |
362 | 362 | StringList ak = new StringList(anchors); |
363 | 363 | Analyzer an = new SplitAnalyzer(1,false); |
364 | 364 | Document doc = new Document(); |
365 | | - doc.add(new Field("article_pageid",pageId,Field.Store.YES,Field.Index.UN_TOKENIZED)); |
| 365 | + doc.add(new Field("article_pageid",pageId,Field.Store.YES,Field.Index.NOT_ANALYZED)); |
366 | 366 | // ns:title |
367 | | - doc.add(new Field("article_key",t.getKey(),Field.Store.YES,Field.Index.UN_TOKENIZED)); |
| 367 | + doc.add(new Field("article_key",t.getKey(),Field.Store.YES,Field.Index.NOT_ANALYZED)); |
368 | 368 | if(redirectsTo != null) |
369 | 369 | // redirect_ns:title|target_ns:title |
370 | | - doc.add(new Field("redirect",redirectsTo+"|"+t.getKey(),Field.Store.YES,Field.Index.UN_TOKENIZED)); |
| 370 | + doc.add(new Field("redirect",redirectsTo+"|"+t.getKey(),Field.Store.YES,Field.Index.NOT_ANALYZED)); |
371 | 371 | else{ |
372 | 372 | // a list of all links/anchors |
373 | | - doc.add(new Field("links",lk.toString(),Field.Store.NO,Field.Index.TOKENIZED)); |
374 | | - doc.add(new Field("anchors",ak.toString(),Field.Store.NO,Field.Index.TOKENIZED)); |
| 373 | + doc.add(new Field("links",lk.toString(),Field.Store.NO,Field.Index.ANALYZED)); |
| 374 | + doc.add(new Field("anchors",ak.toString(),Field.Store.NO,Field.Index.ANALYZED)); |
375 | 375 | } |
376 | 376 | |
377 | 377 | writer.addDocument(doc,an); |