EZP-26630: Support per-query raw filters#200
EZP-26630: Support per-query raw filters#200peterkeung wants to merge 1 commit intoezsystems:masterfrom
Conversation
|
Ping @moismailzai @benkmugo |
|
+1 this looks good to me. I can confirm this patch is functional and works well in practice (that is, the filter range is limiting results as expected). |
|
The flexibility this adds is a good improvement I think. It avoids having to use workarounds or going via the raw solr fetch in template land. +1 |
|
+1 (apart from remark) |
| */ | ||
| public function search( $query, $offset = 0, $limit = 10, $facets = null, | ||
| $filters = null, $sortBy = null, $classID = null, $sectionID = null, | ||
| $filters = null, $rawFilters = null, $sortBy = null, $classID = null, $sectionID = null, |
There was a problem hiding this comment.
why not add it as last param? better for BC
There was a problem hiding this comment.
Sure -- easy change to make. @andrerom who else would we need approval from before merging?
There was a problem hiding this comment.
Well this BC point should probably be fixed and then maybe there is another approval coming :)
There was a problem hiding this comment.
OK, $rawFilters has been moved to the last param now!
ea19ed3 to
639b532
Compare
|
I don't like that the parameters +1 |
|
I think adding a brief inline doc note about those two parameter values would be a good idea. |
639b532 to
95ccbe8
Compare
|
+1 |
|
Let's get this merged! |
https://jira.ez.no/browse/EZP-26630
In eZ Find, all filters expect to follow the pattern field:value. If you don't have a colon, ezfeZPSolrQueryBuilder::getParamFilterQuery() prepends a colon, effectively breaking some filters. This prevents you from adding special filters for the "fq" parameter in Solr, such as frange queries:
http://solr.pl/en/2011/05/30/quick-look-frange/
An example use case is to enforce a minimum relevance score:
{!frange l=1}query({!edismax v=$q})You can get around this by using RawFilterList in ezfind.ini, but that's applied to every query.
This proposed solution would add a new parameter "raw_filter" to the ezfind/search fetch function:
'raw_filter', array( '{!frange l=1\}query({!edismax v=$q\})' ),