How to change the behavior of Solr to send 2-word queries? (under plone)

I use the collective Solr 4.1.0 Search on our Plone 4.2.6 system. So far so good, there is one problem that I have not yet been able to fix. When the user enters “Michael Smith” in the search field, the request is passed to Solr, as in the following example:

+((givenName:(Michael) (Smith)) OR (surname:(Michael) (Smith)))

Thus, both givenName and last name fields are searched only for Michael. I would prefer it like this:

+((givenName:(Michael OR Smith)) OR (surname:(Michael OR Smith)))

Since I select a user record with {value} or {base_value} that automatically does it (Michael) (Smith), I don’t know how to tell Solr to put an “OR” inbetween or how to change the user’s request anyway.

+4
source share
1

: . , +(surname:{base_value}), +(surname:(Michael) (Smith)). .

{base_value} . +surname:({base_value}), +surname:((Michael) (Smith)) , , "OR" .

+3

Source: https://habr.com/ru/post/1622774/


All Articles