Hi All ,

I have created a SolrClient bean and checking how to use it with SolrStream.

@Configuration(proxyBeanMethods = *false*)
SolrConfiguration Class

 @Bean

    *public* SolrClient solrClient() {

       String solrBaseUrl="http://***";;

        *return* *new* Http2SolrClient.Builder(solrBaseUrl).build();



    }


Another Streaming  Class


ex:

 *public* List<Map<String, Object>> streamQuery(String expr) {

    List<Map<String, Object>> tuples = *null*;

    ModifiableSolrParams params = *new* ModifiableSolrParams();

    params.set("expr", expr);

    params.set("qt", "/stream");

    TupleStream tupleStream = *new* SolrStream("http://***";, params)

    StreamContext context = *new* StreamContext();

    tupleStream.setStreamContext(context);

    tuples = getTuples(tupleStream);

}


this works but is there any other way to use the existing SolrClient. I
don't have zookeeper setup as of now


Regards

sambasiva

Reply via email to