Exact phrase near other terms

Is there a way to search for one or more exact phrases near one or more other terms/phrases?

I'm using MatchPhrase with slop zero to find exact phrases fine and using Match to find two or more terms near each other but how do you combine the two please?

If a user entered...
Surname(s): Duck Mouse
Forename(s): Michael Donald
The query should match documents that contain pairs from the specified forename(s) and surname(s). e.g. "Michael Mouse", "Michael Rupert Mouse" (with slop), "Donald Duck", "Michael Duck".
The query should not match documents that contain "Duck Mouse".

If a user entered...
Surnames(s): Jones
Forename(s): "Anne Marie"
The query should match documents that contain "Anne Marie" near Jones and not just Anne near Jones or Marie near Jones, because they have qualified "Anne Marie" as a phrase.

If they didn't qualify Anne Marie as a phrase then the query should match instances of each forename and surname pair.

I have the unqualified forename and surname pairs working fine.
I am able to search for the exact phrase match fine.
It is doing the exact phrase match for a qualified term AND that being near to another term I am not sure how to achieve.
Potentially a user might want to specify qualified terms for both surname and forename and again I would want results where "fname1 fname2" is near "sname1 sname2".

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.