Parentheses lead to incorrect query results
The following queries should return the same number of results.
FIND Guitar with price>10 and ( references Manufacturer with latitude )
FIND Guitar with price>10 and ( which references Manufacturer with latitude )
And those should be the same too:
FIND Guitar which has a property price>10 and ( has a PROPERTY longitude and has a PROPERTY electric)
FIND Guitar which has a property price>10 and has a PROPERTY longitude and has a PROPERTY electric
This leads to and error:
FIND Guitar which has a price and which has a Photograph or which has a electric
This does not:
FIND Guitar which has a price and (which has a Photograph or which has a electric)
Parentheses break the following:
find guitar with price and ( with Photograph)
And what is the difference here:
FIND Guitar which has price and ( which references Manufacturer or which has electric=FALSE )
FIND Guitar which has price and ( references Manufacturer or has electric=FALSE )
And why does the order in the or conjunction matter?
FIND Guitar which has price and (has electric="FALSE" or references Manufacturer )
FIND Guitar which has price and ( references Manufacturer or has electric="FALSE" )
Introducing parentheses into
FIND Guitar has price and has electric="TRUE" and -> Manufacturer
Parsetree:
(cq FIND (entity Guitar) (entity_filter (which_exp has ) (conjunction (filter_expression (pov (property price ))) and (which_exp has ) (filter_expression (pov (property electric) = (value (atom (double_quoted " TRUE ")) ))) and (filter_expression (pov -> (value (atom Manufacturer)))))) <EOF>)
Changes one filter to a subproperty filter, and the result changes
- Query:
FIND Guitar has price and (has electric="TRUE" and -> Manufacturer )
(cq FIND (entity Guitar) (entity_filter (which_exp has ) (conjunction (filter_expression (pov (property price ))) and ( (conjunction (filter_expression (subproperty (subproperty_filter (which_exp has ) (filter_expression (pov (property electric) = (value (atom (double_quoted " TRUE ")) )))))) and (filter_expression (pov -> (value (atom Manufacturer) )))) ))) <EOF>)