Package net.sf.katta.lib.lucene

Examples of net.sf.katta.lib.lucene.LuceneClient.search()


  @Test
  public void testNonExistentShard() throws Exception {
    final Query query = new QueryParser(Version.LUCENE_30, "", new KeywordAnalyzer()).parse("foo: bar");
    ILuceneClient client = new LuceneClient(_miniCluster.getZkConfiguration());
    try {
      client.search(query, new String[] { "doesNotExist" });
      fail("Should have failed.");
    } catch (KattaException e) {
      assertEquals("Index [pattern(s)] '[doesNotExist]' do not match to any deployed index: []", e.getMessage());
    }
    client.close();
View Full Code Here


  @Test
  public void testIndexPattern() throws Exception {
    deploy3Indices();
    ILuceneClient client = new LuceneClient(_miniCluster.getZkConfiguration());
    final Query query = new QueryParser(Version.LUCENE_30, "", new KeywordAnalyzer()).parse("foo: bar");
    final Hits hits = client.search(query, new String[] { "index[2-3]+" });
    assertNotNull(hits);
    for (final Hit hit : hits.getHits()) {
      writeToLog(hit);
    }
    assertEquals(8, hits.size());
View Full Code Here

        // docFreq.
        return docFreq;
      }
    };
    final Query query = new QueryParser(Version.LUCENE_30, "", new KeywordAnalyzer()).parse("foo: bar");
    client.search(query, new String[] { INDEX_NAME }, 10, null);
    // client.search(query, new String[] { INDEX_NAME }, 10, new Sort(new
    // SortField("foo", SortField.STRING)));
    client.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.