Package org.apache.lucene.search

Examples of org.apache.lucene.search.MultiSearcher


    IndexReader reader2 = IndexReader.open(ramDir2);

    IndexSearcher searchers[] = new IndexSearcher[2];
    searchers[0] = new IndexSearcher(ramDir1);
    searchers[1] = new IndexSearcher(ramDir2);
    MultiSearcher multiSearcher = new MultiSearcher(searchers);
    QueryParser parser = new QueryParser(FIELD_NAME, new StandardAnalyzer());
    parser.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
    query = parser.parse("multi*");
    System.out.println("Searching for: " + query.toString(FIELD_NAME));
    // at this point the multisearcher calls combine(query[])
    hits = multiSearcher.search(query);

    // query = QueryParser.parse("multi*", FIELD_NAME, new StandardAnalyzer());
    Query expandedQueries[] = new Query[2];
    expandedQueries[0] = query.rewrite(reader1);
    expandedQueries[1] = query.rewrite(reader2);
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.MultiSearcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.