Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OR in a Boolean Query #23

Open
milliondreams opened this issue Aug 25, 2014 · 2 comments
Open

Support OR in a Boolean Query #23

milliondreams opened this issue Aug 25, 2014 · 2 comments

Comments

@milliondreams
Copy link
Member

Is this already supported? Else we need to add this support.

@trulite
Copy link
Member

trulite commented Aug 25, 2014

I will try to explain using an example:

Let's assume that there are two clauses: Clause A and Clause B. Now the effect of the BooleanClause.Occur will be as follows:

In first case, both clause A and B have BooleanClause.Occur.Should flag set. This will imply that even if one of the clause is satisfied (A or B), then the document will be a hit.

In second case, clause A has BooleanClause.Occur.Must flag set and clause B has BooleanClause.Occur.Should flag set.

In this case, a document will be a hit when it "will" satisfy clause A. Whether this document satisfies clause B or not will have no effect on it being a hit.

But if the document does not satisfies clause A, then no matter whether it satisfies clause B or not, it will not be a hit.

In third case, both clause A and clause B have the BooleanClause.Occur.Must flag set.

In this case, a document will be a hit, only when it will satisfy "both" the clauses. If it will fail to satisfy even one of the clause, then it will not be a hit.

@milliondreams
Copy link
Member Author

Will be a great help if you could put some JSON Queries explaining these examples...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants