Package org.apache.lucene.search

Examples of org.apache.lucene.search.MultiPhraseQuery.rewrite()


        }
        if (terms.isEmpty()) {
            return MatchNoDocsQuery.INSTANCE;
        }
        query.add(terms.toArray(new Term[terms.size()]), position);
        return query.rewrite(reader);
    }

    private void getPrefixTerms(List<Term> terms, final Term prefix, final IndexReader reader) throws IOException {
        TermEnum enumerator = reader.terms(prefix);
        try {
View Full Code Here


        }
        if (terms.isEmpty()) {
            return Queries.newMatchNoDocsQuery();
        }
        query.add(terms.toArray(Term.class), position);
        return query.rewrite(reader);
    }

    private void getPrefixTerms(ObjectOpenHashSet<Term> terms, final Term prefix, final IndexReader reader) throws IOException {
        // SlowCompositeReaderWrapper could be used... but this would merge all terms from each segment into one terms
        // instance, which is very expensive. Therefore I think it is better to iterate over each leaf individually.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.