View Issue Details

IDProjectCategoryView StatusLast Update
970Composrsearchpublic2014-08-11 13:40
ReporterLhasadreams Assigned ToChris Graham  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Summary970: Better support for negated search results
DescriptionHi,
If you do a search like
+brake +pipe -2010 -stand
and check the box "Find exact matches (boolean search, may be slow)"

Then search still returns results with the words 2010 and stand in the titles, however it respects the search parameters for the contents.

If you tick the search titles only box then it behaves as expected.

Cheers
Ade
TagsNo tags attached.
Attach Tags
Time estimation (hours)30
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Relationships

related to 1036 ResolvedChris Graham Localise translate table 

Activities

Chris Graham

2013-01-09 18:16

administrator   ~1129

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.

Chris Graham

2014-08-11 13:27

administrator   ~2223

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.

Chris Graham

2014-08-11 13:40

administrator   ~2224

Actually, remove the above caveat - I believe I can workaround that.

Issue History

Date Modified Username Field Change