We're updating the issue view to help you get more done. 

Boolean queries involving NOT return incorrect results (ElasticSearch; SqlSearch)

Description

Looks like NOT queries are also always handled correctly, even basic ones. Extreme example: the query string
smith NOT smith
gets sent to ES as
"(+(smith) (smith)) AND (ca_objects
/deleted:0)"
and returns all the objects related to smith, instead of none at all.
Unfortunately the quick fix of inserting the "-" in the appropiate line is not enough, there are compounding rewrite issues.

In fact even SqlSearch is not immune, for example searches like smith OR NOT xxx fail to rewrite and all return null in all cases.

Environment

None

Assignee

User known

Reporter

yelto

Labels

None

Components

Affects versions

Priority

Major
Configure