Examples of MatchAllDocsQuery


Examples of org.apache.lucene.search.MatchAllDocsQuery

    map = new HashMap<String,Float>();
    map.put("rabbit", 5.0f);
    map.put("dog", 7.0f);
      boostMaps.put("tag", map);
     
      Query q = new ScoreAdjusterQuery(new MatchAllDocsQuery(), new FacetBasedBoostScorerBuilder(boostMaps));
     
      BrowseRequest br = new BrowseRequest();
      br.setQuery(q);
    br.setOffset(0);
    br.setCount(10);
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

* @author java6
*
*/
public class ProtoBufConvertTest extends TestCase {
  public void testConvertMatchAllDocsQuery() throws ParseException {
    doConvert(new MatchAllDocsQuery());
  }
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

      idSel.addNotValue(_idRanges[0]);
      int expectedHitNum = 1;
      br.addSelection(idSel);
      BooleanQuery q = new BooleanQuery();
      q.add(NumericRangeQuery.newIntRange("NUM", 10, 10, true, true), Occur.MUST_NOT);
      q.add(new MatchAllDocsQuery(), Occur.MUST);
      br.setQuery(q);
     
      result = boboBrowser.browse(br);
     
      assertEquals(expectedHitNum,result.getNumHits());
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

    try
    {
      Query q = req.getQuery();
      if (q == null)
      {
        q = new MatchAllDocsQuery();
      }
      w = createWeight(q);
    }
    catch (IOException ioe)
    {
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

      hits = new BrowseHit[0];
    }
   
    Query q = req.getQuery();
    if (q == null){
      q = new MatchAllDocsQuery();
    }
    if (req.isShowExplanation()){
      for (BrowseHit hit : hits){
        try {
        Explanation expl = explain(q, hit.getDocid());
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

   * @deprecated use {@link org.apache.lucene.search.MatchAllDocsQuery} instead.
   * @return query that matches all docs in the index
   */
  public Query getFastMatchAllDocsQuery()
  {
    return new MatchAllDocsQuery();
  }
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

    try
    {
      Query q = req.getQuery();
      if (q == null)
      {
        q = new MatchAllDocsQuery();
      }
      w = createWeight(q);
    }
    catch (IOException ioe)
    {
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

        if (weight == null)
        {
          Query q = req.getQuery();
          if (q==null)
          {
            q = new MatchAllDocsQuery();
          }
          weight = createWeight(q);
        }
        search(weight, finalFilter, collector, start);
      }
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

      hits = new BrowseHit[0];
    }
   
    Query q = req.getQuery();
    if (q == null){
      q = new MatchAllDocsQuery();
    }
    if (req.isShowExplanation()){
      for (BrowseHit hit : hits){
        try {
        Explanation expl = explain(q, hit.getDocid());
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

         * of the supplied conditions should match in the result set.
         */
        if (condition.getSpecifier().isNegation() && !matchAllConditions) {
          BooleanQuery nestedquery = new BooleanQuery();
          nestedquery.add(clause);
          nestedquery.add(new BooleanClause(new MatchAllDocsQuery(), Occur.MUST));
          fieldQuery.add(new BooleanClause(nestedquery, Occur.SHOULD));
        }

        /* Normal Case */
        else {
          fieldQuery.add(clause);
        }
      }

      /* Add the MatchAllDocsQuery (MUST_NOT is used, All Conditions match) */
      if (fieldQuery != null && matchAllConditions) {
        boolean requireAllDocsQuery = true;
        BooleanClause[] clauses = fieldQuery.getClauses();
        for (BooleanClause clause : clauses) {
          if (clause.getOccur() != Occur.MUST_NOT) {
            requireAllDocsQuery = false;
            break;
          }
        }

        /* Add if required */
        if (requireAllDocsQuery)
          fieldQuery.add(new BooleanClause(new MatchAllDocsQuery(), Occur.MUST));
      }

      /* Use custom hit collector for performance reasons */
      final List<SearchHit<NewsReference>> resultList = new ArrayList<SearchHit<NewsReference>>();
      HitCollector collector = new HitCollector() {
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.