Package org.apache.lucene.search

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


        }
        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

      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

   }

   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

   }

   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

      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

  }

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

        }
        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

        }
        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

      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

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.