I would raise it on issue tracker looks like there is a problem with the underlying DSL that generates the lucene query. For now as a working around you can make the query yourself and use examine raw query.
Well Examine's AND OR and NOT aren't really synonymous with Lucene. The syntax was created so that people familiar with SQL query logic could try to grasp what is happening. The And() operator just ensures that a '+' is prefixed (in lucene = MUST) and Or() doesn't prefix anything and NOT() is actually synonymous and prefixes '-'
I've actually never tested not having the fluent And(), Or() or Not() fluency with queries so if it works that is by fluke i suppose. If you post the issue with steps to re-create i'll fix it this week as I need to release another update.
Examine - GroupedNot issue
Hi folks, I ran into strange situation with GroupedNot method, when I'm trying to set NodeTypeAlias filter and then GroupedNot filter like this:
I'm getting Lucene Query like this:
So I has correct NodeTypeAlias value but the rest is messed up. Instead of
there should be
For example if I make the same steps with GroupedOr method, Examine appears to work correctly:
gives:
Any ideas if this is a bug or a feature ? :)
Many thanks, Pawel
Pawel,
I would raise it on issue tracker looks like there is a problem with the underlying DSL that generates the lucene query. For now as a working around you can make the query yourself and use examine raw query.
Regards
Ismail
Hey Ismail,
big thanks for reply!
that's what I'm going to do, I was just wondering if it is something underlying or I'm doing something wrong.
Greetings,
Pawel
@Pawel, did you create an issue ? https://github.com/Shazwazza/examine/issues
Also you are not using And() which is how to join things (or Or() or Not()):
Please create an issue on the tracker so it can be resolved.
Hi Shannon,
I'm using searchCriteria with default operation set to AND, so in the end it looks like the code you've posted.
I think the soulution might be to ommit AND operation when parsing query from Examine do Lucene because by default NOT operator works like AND NOT.
I will post the issue on github and I could also try to fix it if you have better things to do right now :)
Cheers,
Pawel
Well Examine's AND OR and NOT aren't really synonymous with Lucene. The syntax was created so that people familiar with SQL query logic could try to grasp what is happening. The And() operator just ensures that a '+' is prefixed (in lucene = MUST) and Or() doesn't prefix anything and NOT() is actually synonymous and prefixes '-'
I've actually never tested not having the fluent And(), Or() or Not() fluency with queries so if it works that is by fluke i suppose. If you post the issue with steps to re-create i'll fix it this week as I need to release another update.
is working on a reply...