Question

I am new to solr,am using pysolr, I have a very basic question.

How can I add a facet to the pysolr query?
my solr query is: ip:8983/solr....q=...&facet=on&facet.field=xyz

its working in browser as I wish.

I want to know how can I implement it in my following code,

what the syntax to add facet in pysolr(facet=on&facet.field=xyz )

**

solrquery = "(.................. )" 
 solr.search([solrquery],)

**

Was it helpful?

Solution

Use

solrquery = "(.................. )" 
solr.search([solrquery],facet = 'on' ,** {'facet.field' : ['fieldname']})
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top