0
votes

I have a search engine for medical terms that run using Nutch and Solr, it uses a PHP frontend. Along with the search result it will show tagging count for thousands of a predefined terms, the tagging results are retrieved through passing all the terms to solr via a solr facet query.

How to add all these terms in solr without passing these through the query every time and then get then get the facet counts for each term in the search result. Part of my query for retrieving facet counts is given below:

fl=content,url&facet=true&facet.field=host&facet.zeros=false&facet.query=content:Pfizer&facet.query=content:Teva&facet.query=content:Genentech&facet.query=content:Abbot&facet.query=content:Constipation&facet.query=content:Constipate&facet.query=content:Constipated&facet.query=content:Constipates&facet.query=content:Constipation&facet.query=content:Diarrhea&facet.query=content:Depression&facet.query=content:Depressions&facet.query=content:Depressed&facet.query=content:Sad&facet.query=content:Cramps&facet.query=content:Cough&facet.query=content:Xyrem&facet.query=content:Abilify&facet.query=content:Metformin&facet.query=content:Avastin'

Thanks in advance.

1

1 Answers

0
votes

The most that could be done here is reducing your query to the following.

...
facet.query = content: [OR Pfizer Teva Genentech Abbot ... Avastin]
...

Or, you could you use "facet.method=enum" where based on the field, facets for all values will be returned.

I could find no other way in Solr where you can save the "query variables" itself in a cache using a key or tag. Nevertheless, Solr has LocalParams called "tag", "ex" and "key" but they do not fit the requirements you are after.

References:

  1. http://solr.pl/en/2010/12/06/faceting-eliminowanie-filtrow-i-jak-z-tego-skorzystac/
  2. http://wiki.apache.org/solr/SimpleFacetParameters
  3. http://wiki.apache.org/solr/SolrFacetingOverview