rsolr not returning facet fields

152 views Asked by At

I'm working on a solr project which indexes text documents of students. I'm using rsolr to get all documents of a cohort. Additionally I want to know which facets are available for the cohort field. The problem is that the rsolr-generated response doesn't return the facet fields correctly while a http request does. I'm new to rsolr and the GitHub documentation isn't helpful in this case.

This is my http request which returns two correct cohort facets:

.../select?indent=on&q=cohort:"IT3 WS 2013/2014"&fl=author&facet=on&facet.field=cohort

This is my rsolr code: I'm searching for a specific cohort (IT3 WS 2013/2014) in the cohort field to get all documents.

solr = RSolr.connect :url => 'http://127.0.0.1:8983/solr/LaepD'
response = solr.get 'select', :params => {
  :q=>'IT3 WS 2013/2014',
  :fl=>['author', 'title'],
  :qf => 'cohort',
  :wt => :ruby,
  :hl => false,
  :rows => 1000,
  :facet => true,
  :facet_fields => 'cohort'
  #:facet_limit => 10,
  #:facet_mincount => 2
}

Thank you!

1

There are 1 answers

1
Paul Libbrecht On

I would strongly suspect that the field is not indexed. Can it be?

For a field to be faceted it must be indexed (see, e.g. the faceting page of the Solr guide).

paul