Closed TiSiE closed 5 years ago
Hello @TiSiE,
I am still confusing where to actually put this default filter query. Do you want this line 69 and 71 to be configurable?
That's a great idea. Lets make these lines configurable.
We have the following UseCase.
2 YAWIK installations use a shared Solr index. The installations should make only a subset of the Solr searchable.
One installation, for example, only provides job advertisements from Germany. The other only advertisements of certain companies.
so one installation can cofigure
fiterQuery=[ 'entityName:job', 'isActive:1', 'fieldXY:mysubset' ]
$fiels=[ '*' ]
In case of a spatial search, the filterQuery is more complicated. But it' possible to define.
@TiSiE , @cbleek
I try to implementing filter queries by adding new filterQueries
options. This values will accept an array list of string/callable values. The configuration for this filterQueries
options will be like:
$options = [
"filterQueries" => [
"entityName:job",
// ... other string value or:
function(SolrDisMaxQuery $query){
$query->addFilterQuery('some-filter');
}
]
];
return [ 'options' => [ 'Solr/Options/Module' => [ 'options' => $options ] ] ];
Please let me know if there are any suggestion for implementing this configurable filter queries.
It should be possible to configure default filter queries which are used for every search request regardless of user input via the search form.
Solr provides the ability to define such filter queries so we should use this. All we have to do is: