0
votes

Solr provides way to query in JSON Format -

curl http://localhost:8983/solr/techproducts/query -d ' { "query" : "memory", "filter" : "inStock:true" }'

Can I just pass this json as it is to SOLRJ Client. I need to intercept the request and pass it as it is.

2

2 Answers

0
votes

SolrJ client send queries as url parameters (q=memory&fq=inStock:true) and response type is javabin https://wiki.apache.org/solr/javabin

You can use apache http client and set your JSON query and fire request to Solr.

0
votes

Essentially, we can also set the parameter "json" and the query in SolrJ SolrQuery:

SolrQuery.add("json", "{json query here}")