Package org.apache.solr.client.solrj.impl

Examples of org.apache.solr.client.solrj.impl.HttpSolrServer.query()


        final ModifiableSolrParams params = new ModifiableSolrParams();
        params.set("qt", "/");
        params.set("q", field + ":" + term);
        final SolrRequest req = new QueryRequest(params);

        final QueryResponse resp = solr.query(params);
        System.out.println("resp: " + resp);
    }
}
View Full Code Here


      tool = new MapReduceIndexerTool();
      res = ToolRunner.run(jobConf, tool, args);
      assertEquals(0, res);
      assertTrue(tool.job.isComplete());
      assertTrue(tool.job.isSuccessful());
      results = server.query(new SolrQuery("*:*"));
      assertEquals(20, results.getResults().getNumFound());
    }   
   
    fs.delete(inDir, true);  
    fs.delete(outDir, true)
View Full Code Here

      tool = new MapReduceIndexerTool();
      res = ToolRunner.run(jobConf, tool, args);
      assertEquals(0, res);
      assertTrue(tool.job.isComplete());
      assertTrue(tool.job.isSuccessful());     
      results = server.query(new SolrQuery("*:*"));
     
      assertEquals(22, results.getResults().getNumFound());
    }   
   
    // try using zookeeper
View Full Code Here

      for (Replica replica : replicas) {
        HttpSolrServer client = new HttpSolrServer(
            new ZkCoreNodeProps(replica).getCoreUrl());
        SolrQuery query = new SolrQuery("*:*");
        query.set("distrib", false);
        QueryResponse replicaResults = client.query(query);
        long count = replicaResults.getResults().getNumFound();
        if (found != -1) {
          assertEquals(slice.getName() + " is inconsistent "
              + new ZkCoreNodeProps(replica).getCoreUrl(), found, count);
        }
View Full Code Here

                SolrQuery q = store.count(getSchema(), preQuery);
                if (store.getLogger().isLoggable(Level.FINE)) {
                    store.getLogger().log(Level.FINE, q.toString());
                }
                HttpSolrServer server = store.getSolrServer();
                QueryResponse rsp = server.query(q);
                count = new Long(rsp.getResults().getNumFound()-rsp.getResults().getStart()).intValue();
                //Manage max manually
                if (query.getMaxFeatures() > 0 && query.getMaxFeatures() < Integer.MAX_VALUE) {
                    if(count > query.getMaxFeatures()){
                        count = query.getMaxFeatures();
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.