/** * Constructs a LuceneSearcher that will run lucene queries on sets of articles * in any language in the LanguageSet. Note that root is the parent directory * of the directory where lucene indexes are stored, though it is the same * directory as was passed to the LuceneIndexer. * * @param languages the language set in which this searcher can operate * @param root the root directory in which each language contains its own lucene directory */ public LuceneSearcher(LanguageSet languages, File root) { this(languages, root, LuceneOptions.getDefaultOptions()); }
@Override public LuceneOptions get(String name, Config config, Map<String, String> runtimeParams) throws ConfigurationException { if (!name.equalsIgnoreCase(config.getString("type"))) { throw new ConfigurationException("Could not find configuration " + name); } return new LuceneOptions( name, getConfigurator(), config.getString("version"), config.getString("directory"), config.getStringList("namespaces"), buildOptions( config.getBoolean("caseInsensitive"), config.getBoolean("useStopWords"), config.getBoolean("useStem")), buildElements( config.getInt("title"), config.getBoolean("redirects"), config.getBoolean("plaintext")) ); } }
/** * Constructs a WikiBrainAnalyzer for the specified language with all filters * and default options. * * @param language the language this analyzer analyzes */ public WikiBrainAnalyzer(Language language) { this(language, LuceneOptions.getDefaultOptions()); }
/** * Constructs a LuceneIndexer that will index any RawPage in a * specified Language. Indexes are then placed in language-specific * subdirectories in the specified file. * * @param language the language in which this searcher can operate * @param root the root directory in which to save all the lucene directories */ public LuceneIndexer(Language language, File root) throws ConfigurationException { this(language, root, LuceneOptions.getDefaultOptions()); }