Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Solr term component with filtering on non-term fields

Tags:

solr

http://localhost:8080/search/terms?terms.prefix=ab&terms.fl=text&terms.sort=count

I have the above terms query which works as I expect. Returns all the terms from the "text" field that have a certain prefix, sorted by count.

I want to return only the terms where another field "language" is "en" can I add such a filter to a terms query?

like image 431
Nick Avatar asked Feb 06 '12 22:02

Nick


1 Answers

Unfortunately you can't filter while accessing the indexed terms within a field through the TermsComponent. That's one of the limitations you face when you make auto suggestions for example. If you're making auto-suggestions, one of the ways that supports filtering is based on a facet and the prefix parameter like explained here.

like image 70
javanna Avatar answered Sep 29 '22 09:09

javanna