Package org.apache.lucene.search

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


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

      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

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

      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

   * @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

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

        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

      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

         * 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

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

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.