ezsystems/ezpublish-kernel — pull request #497 by kore (2013-09-06 12:43:10+00:00)
Title: Search filter refactoring

The interfaces of Elastic Search, Solr and the old eZ Publish query interface separate between "filters" and "queries". This separation has semantical, implementation and performance constraints. This pull request introduces an additional query parameter, while considering the yet existing criteria as filters. Additionally it includes extensions to the full text query.

All internal usage of the search handler has been adapted according to the BC break mentioned below.

I decided that it makes no sense to introduce the $query parameter to the findSingle() method. The criteria passed to findSingle() are interpreted as filters now.

The extended fulltext criterion supports now boosting for certain fields (Boost titles of found content objects by 2) and allows fuzzy queries to the full text index. Both features only work with Solr so far.

The pull request adds additional tests for combinations of queries with filters.

All criteria still work as filters and queries.

## Backwards Compatibility (BC) Break

The Query value object yet had the property $criteria which defined how to query the database. We now differentiate between filters and the actual (full text) query. Thus the old property has been removed and two new properties were introduced: $filter and $query.

This breaks BC. Options to not break BC are:

1) Use $criteria for filters: Still changes the scoring in results (Filter do not affect scoring), and the property name does not really makes sense.

2) User $criteria for query: Almost no BC break, but makes semantically no sense at all.