#970 - Better support for negated search results

This is a spacer post for a website comment topic. The content this topic relates to: #970 - Better support for negated search results
This is really tricky. The search engine has to query MySQL separately against each field, because MySQL is not capable of efficiently running against all fields in a single query (not where our internationalised/Comcode text is concerned).

So it is returning results because one of the fields, in isolation, matches the condition.

We could try and solve it by 3 mechanisms:
1) Create a separate combined text index, separate to main fields
2) Make internationalisation optional
3) Do a set operation to subtract any positive search results for the requested negative criteria

All these would be very labour intensive, so I think it is best just to state that the filter works on each individual field.
This will now work if multi-lang-content has been disabled.

However I should note there is still a case that cannot be handled...

If you declare two forced-positive match terms, and they apply, but not all to any single field together, it can't get a match.

E.g. +foo +bar would not match if something had a title of "some foo" and content of "some bar". But it would match if the content was "some foo bar".

This is due to the matching working on individual fields. The overall logic is now combined, with negatives hitting one field disallowing any other fields from matching - but it still operates on individual fields at heart.

This probably is not something many people will ever notice, as it is unlikely a title will be the only place a forced-positive match term will appear.
Actually, remove the above caveat - I believe I can workaround that.
0 guests and 0 members have recently viewed this.