1 11 package org.eclipse.help.internal.search; 12 13 import java.io.File ; 14 import java.net.URL ; 15 16 import org.apache.lucene.document.Document; 17 import org.apache.lucene.document.Field; 18 import org.eclipse.core.runtime.IStatus; 19 import org.eclipse.help.internal.base.HelpBasePlugin; 20 import org.eclipse.help.internal.toc.TocManager; 21 22 28 public class SearchIndexCache extends SearchIndex { 29 30 private String filters; 31 32 40 public SearchIndexCache(String locale, AnalyzerDescriptor analyzerDesc, TocManager tocManager) { 41 super(new File (HelpBasePlugin.getConfigurationDirectory(), "indexCache/" + locale), locale, analyzerDesc, tocManager, null); 43 } 44 45 56 public IStatus addDocument(String name, URL url, String filters) { 57 this.filters = filters; 58 return super.addDocument(name, url); 59 } 60 61 protected void addExtraFields(Document doc) { 62 super.addExtraFields(doc); 63 if (filters != null) { 64 doc.add(Field.UnIndexed("filters", filters)); } 66 } 67 } | Popular Tags |