Examples of MatchAllDocsQuery


Examples of org.apache.lucene.search.MatchAllDocsQuery

    }
  }

  public void testMatchAllDocs() throws Exception {
    QueryParser qp = new QueryParser("field", new WhitespaceAnalyzer());
    assertEquals(new MatchAllDocsQuery(), qp.parse("*:*"));
    assertEquals(new MatchAllDocsQuery(), qp.parse("(*:*)"));
    BooleanQuery bq = (BooleanQuery)qp.parse("+*:* -*:*");
    assertTrue(bq.getClauses()[0].getQuery() instanceof MatchAllDocsQuery);
    assertTrue(bq.getClauses()[1].getQuery() instanceof MatchAllDocsQuery);
  }
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

        }
        if (nonFullTextConstraints) {
            addNonFullTextConstraints(qs, filter, reader);
        }
        if (qs.size() == 0) {
            return new MatchAllDocsQuery();
        }
        if (qs.size() == 1) {
            return qs.get(0);
        }
        BooleanQuery bq = new BooleanQuery();
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

      cache.put("IT", italy);
      List<Object> list = qf.getQuery(query, Country.class, City.class).list();
      Assert.assertEquals( 1 , list.size() );
      list = qf.getQuery(query).list();
      Assert.assertEquals( 1 , list.size() );
      list = qf.getQuery( new MatchAllDocsQuery() ).list();
      Assert.assertEquals( 1 , list.size() );
   }
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

   }

   protected void assertIndexSize(int expectedIndexSize) {
      for (Cache cache : caches) {
         SearchManager searchManager = Search.getSearchManager(cache);
         CacheQuery query = searchManager.getQuery(new MatchAllDocsQuery(), Person.class);
         Assert.assertEquals(expectedIndexSize, query.list().size());
      }
   }
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

   }

   protected void assertIndexSize(int expectedIndexSize) {
      for (Cache cache : caches) {
         SearchManager searchManager = Search.getSearchManager(cache);
         CacheQuery query = searchManager.getQuery(new MatchAllDocsQuery(), Person.class);
         Assert.assertEquals(expectedIndexSize, query.list().size());
      }
   }
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

      cache.put("IT", italy);
      List<Object> list = qf.getQuery(query, Country.class, City.class).list();
      Assert.assertEquals( 1 , list.size() );
      list = qf.getQuery(query).list();
      Assert.assertEquals( 1 , list.size() );
      list = qf.getQuery( new MatchAllDocsQuery() ).list();
      Assert.assertEquals( 1 , list.size() );
   }
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

  }

  @Override
  public void readFields(DataInput in) throws IOException {
    float boost = in.readFloat();
    query = new MatchAllDocsQuery();
    query.setBoost(boost);
  }
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

        }
        if (nonFullTextConstraints) {
            addNonFullTextConstraints(qs, filter, reader);
        }
        if (qs.size() == 0) {
            return new MatchAllDocsQuery();
        }
        if (qs.size() == 1) {
            return qs.get(0);
        }
        BooleanQuery bq = new BooleanQuery();
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

        }
        if (nonFullTextConstraints) {
            addNonFullTextConstraints(qs, filter, reader);
        }
        if (qs.size() == 0) {
            return new MatchAllDocsQuery();
        }
        if (qs.size() == 1) {
            return qs.get(0);
        }
        BooleanQuery bq = new BooleanQuery();
View Full Code Here

Examples of org.apache.lucene.search.MatchAllDocsQuery

      addDoc(evilWriter);
      if (random().nextInt(17) == 0) {
        evilWriter.commit();
      }
    }
    evilWriter.deleteDocuments(new MatchAllDocsQuery());
    evilWriter.forceMerge(1);
    evilWriter.close();
    dir.close();
  }
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.