Hi Dhanushka, Have you tried to use the filter query parameter. Check out this article, the Applying Constraints section should be helpful to you. http://www.lucidimagination.com/Community/Hear-from-the-Experts/Articles/Faceted-Search-Solr
Solr Wiki link to filter query parameter http://wiki.apache.org/solr/CommonQueryParameters#fq I am at the moment implementing a similar system where the user needs to drill down to the data. What I am doing now is say if the user selects "Chemistry" from the facet I request a query with the filter query applied to fDepartmentName and when the user selects "US Cancer/Diabetic Research Institute" from the fSponsor facet I will apply filter querying to both the fDepartmentName and fSponsor. Hope this helps. Regards, Indika On 29 March 2010 21:19, Dhanushka Samarakoon <dhan...@gmail.com> wrote: > Hi, > > I'm trying to perform a search based on keywords and then reduce the result > set based on facets that user selects. > First query for a search would look like this. > > > http://localhost:8983/solr/select/?q=cancer+stem&version=2.2&wt=php&start=&rows=10&indent=on&qt=dismax&facet=on&facet.mincount=1&facet.field=fDepartmentName&facet.field=fInvestigatorName&facet.field=fSponsor&facet.date=DateAwarded&facet.date.start=2009-01-01T00:00:00Z&facet.date.end=2010-01-01T00:00:00Z&facet.date.gap=%2B1MONTH > > In the above query (as per dismax on the solr config file) it searches > multiple fields such as GrantTitle, DepartmentName, InvestigatorName, > etc... > > Then if user select 'Chemistry' from the facet field 'fDepartmentName' and > 'US Cancer/Diabetic Research Institute' from 'fSponsor' I need to reduce > the > result set above to only records from where fDepartmentName is 'Chemistry' > and 'fSponsor' is 'US Cancer/Diabetic Research Institute' > The following query is not working. > select/?q=cancer+stem+fDepartmentName:Chemistry+fSponsor:US Cancer/Diabetic > Research Institute&version=2.2& > > Fields starting with 'f' are defined in the schema.xml as copy fields. > <field name="DepartmentName" type="text" indexed="true" stored="true" > multiValued="true" /> > <field name="fDepartmentName" type="string" indexed="true" stored="false" > multiValued="true" /> > <copyField source="DepartmentName" dest="fDepartmentName"/> > > Any ideas on the correct syntax? > > Thanks, > Dhanushka. >