ezsystems/ezfind — pull request #58 by dpobel (2012-06-20 12:41:03+00:00)
Title: Fixed #19445: Stop words are preventing searches from returning results

(Our reviewboard seems to not work correctly for the moment, that's why I'm creating this pull request)

Description:
============
In some cases, if your search request contains one or several stop words, there's no result even if the search without the stop words returns something. This happens if you have defined a content class with an integer or an ezselection attribute that is indexed because those attributes are indexed in a "string" field in Solr and the "string" fields are not analyzed with the solr.StopFilterFactory filter in schema.xml. As a result, the stop words are still used to search on those attributes so it becomes impossible to satisfy the "Mininmum should match" (mm) parameter of the ezpublish request handler (dismax) in some cases.

For instance, if you search "autosave getting started", you'll get 3 results with the demo content, but "autosave getting started stopworda stopwordb" returns nothing because "stopworda" and "stopwordb" are stop words (!) and with the current settings they are still used to search. It becomes then impossible to satisfy the mm setting of the ezpublish request handler which says that for a request with 5 terms, the resulting documents should at least match for 4 of them.

This patch changes the configuration for integer and ezselection so that those datatypes are indexed in a "text" field and also defined DatatypeMapSort, DatatypeMapFacet and DatatypeMapFilter to not add a BC break on sorting, faceting or filtering on ezselection attributes.

Testing done:
=============
search with stopwords but also "normal" search on ezselection and integer attributes.