Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datastax Solr Java Driver CQL

I am trying use the datastax java connector to talk to dse with solr index.

The HTTP Api gives you back numFound, but I can't seem to figure out how to get that information using cql (java connector).

Can anybody tell me how to get this information? I can make another request

select count(*) from table where solr_quer...

But will this be good thing to do, for every page? Is this what http api doing underneath?

like image 541
daviddecoding Avatar asked Mar 18 '26 16:03

daviddecoding


1 Answers

I am answering my own question, the datastax ResultSet supports sending and receiving custom payloads, so to retrieve DSESearch.numFound:

    ResultSet rows = session.execute(...);
    Map<String,ByteBuffer> serverPayload = rows.getExecutionInfo().getIncomingPayload()
    long numFound = serverPayload.get("DSESearch.numFound").getLong();
like image 123
daviddecoding Avatar answered Mar 21 '26 23:03

daviddecoding