Reputation: 317
I want alist of cities in facet for a particular list of states in fq.
So my query is:
fq: {!tag=state}state_id:(25 41)
facet query: state_id:(25 41)
facet field: {!ex=state}city_id
This works perfectly fine in Solr Admin, whereas when I query it using Solarium:
$facetSet->createFacetQuery('city')->setQuery($facet_q);
$facetSet->createFacetField(array('field'=>'city','exclude'=>'state'));
it gives an empty result.
Thanks in advance.
Upvotes: 1
Views: 745
Reputation: 3131
This is pretty old but the same question is relevant also today.
You can do the following with solarium v6:
$query->createFilterQuery('FilterName')->setQuery('price:340')->addTag('price');
This will be translated to:
fq={!tag=price}price:340
Also:
$facetSet = $query->getFacetSet();
$facetSet->createFacetField('FacetName')->setField('price')->getLocalParameters()->addExcludes(['price']);
This will be translated to:
facet.field={!key=FacetName ex=price}price&facet=true
So as you can see addTag and addExclude should be used.
Upvotes: 0