Package org.apache.lucene.search

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


     * we rewrite against an empty indexreader: as we don't want things like
     * rangeQueries that don't summarize the document
     */
    private static Query rewrite(Query original) throws IOException {
        Query query = original;
        for (Query rewrittenQuery = query.rewrite(EMPTY_INDEXREADER); rewrittenQuery != query;
             rewrittenQuery = query.rewrite(EMPTY_INDEXREADER)) {
            query = rewrittenQuery;
        }
        return query;
    }
View Full Code Here


     * rangeQueries that don't summarize the document
     */
    private static Query rewrite(Query original) throws IOException {
        Query query = original;
        for (Query rewrittenQuery = query.rewrite(EMPTY_INDEXREADER); rewrittenQuery != query;
             rewrittenQuery = query.rewrite(EMPTY_INDEXREADER)) {
            query = rewrittenQuery;
        }
        return query;
    }

View Full Code Here

            //return the already rewritten query
            return highlighterContext.query.query();
        }

        Query query = original;
        for (Query rewrittenQuery = query.rewrite(reader); rewrittenQuery != query;
             rewrittenQuery = query.rewrite(reader)) {
            query = rewrittenQuery;
        }

        //set back the original rewrite method after the rewrite is done
View Full Code Here

            return highlighterContext.query.query();
        }

        Query query = original;
        for (Query rewrittenQuery = query.rewrite(reader); rewrittenQuery != query;
             rewrittenQuery = query.rewrite(reader)) {
            query = rewrittenQuery;
        }

        //set back the original rewrite method after the rewrite is done
        for (Tuple<MultiTermQuery, MultiTermQuery.RewriteMethod> modifiedMultiTermQuery : modifiedMultiTermQueries) {
View Full Code Here

  {
      Query q=parse("FuzzyLikeThisQuery.xml");
      //show rewritten fuzzyLikeThisQuery - see what is being matched on
      if(VERBOSE)
      {
        System.out.println(q.rewrite(reader));
      }
      dumpResults("FuzzyLikeThis", q, 5);
  }
  public void testTermsFilterXML() throws Exception
  {
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.