Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using "terms" vs "select?qt=terms" in Solr

Tags:

solr

I have difficulties with the "/terms" request handler using Solr 4.2.0.

Using the web browser the following url returns the list of terms of the fieldName INDUSTRY

http://localhost:8983/solr/collection1/terms?terms.fl=INDUSTRY&terms.prefix=P&terms=true

On the other hand, the following query returns no terms:

http://localhost:8983/solr/collection1/select?qt=terms&terms.fl=INDUSTRY&terms.prefix=P&terms=true

My question is how can I use the "/terms" requestHandler via the "/select" requestHandler?

The log from Solr is the following (if it is of any help to you)

Apr 12, 2013 10:21:55 AM org.apache.solr.core.SolrCore execute
INFO: [collection1] webapp=/solr path=/terms params={terms.fl=INDUSTRY&terms=true&terms.prefix=P} status=0 QTime=5 
Apr 12, 2013 10:22:09 AM org.apache.solr.core.SolrCore execute
INFO: [collection1] webapp=/solr path=/select params={terms.fl=INDUSTRY&terms=true&qt=terms&terms.prefix=P} hits=0 status=0 QTime=0 
like image 571
Zouzias Avatar asked Apr 12 '13 08:04

Zouzias


1 Answers

The following steps solve the above problem.

First, in solrconfig.xml you should remove the "/select" requestHandler and moreover set handleSelect to true.

  <requestDispatcher handleSelect="true" >

Second, reboot Solr and the following query works:

http://localhost:8983/solr/collection1/select?qt=/terms&terms.fl=INDUSTRY&terms.prefix=P&terms=true

IMPORTANT: notice the "/terms" on the qt parameter, using "qt=terms" will not work..

like image 50
Zouzias Avatar answered Oct 12 '22 23:10

Zouzias