With version 4.8, the behavior of search switch to Solr was like this:
- If the model define one content type at its root
- If there is anoter field named contentTypes and it has a value, this value is used
- If there are several values in the field named contentTypes, the contentTypes are in the query and the content type field is empty
- Otherwise, the content type defined directly on the SearchModel is used
- If the model define several content types at its root, the switch was broken (repaired with recent in issues in recent versions)
- If the model don't define a content type at its root
- If there is a field named contentTypes and it has a value, this value is used
- If there are several values in the field named contentTypes, the contentTypes are in the query and the content type field is empty
- Otherwise, the content type field is empty
With current version, switch to Solr search can supports multiple values in fields but it ignores the root content type(s).
Here is a behavior that could be nicer:
- Simple search:
- Get the value from the contentTypes field if exists and filled.
- Or get the value from the root contentTypes if defined.
- Or get all the final contentTypes (filtered if there are exclusion) from the root SearchModel.
- Advanced search:
- Get the value from the contentTypes field if it is at the root of the query and valid for all the query.
- Or get the value from the root contentTypes if defined.
- Or get all the final contentTypes (filtered if there are exclusion) from the root SearchModel.