Bifalgorithm post · Sahih el Boykhari · Select Collections

Boolean Logic

Boolean Logic (Sahih el Boykhari · Select Collections) — "Boolean operators allow terms to be combined through logic operators. Lucene supports AND, \"+\", OR,…

Ideas in this flowchart

  • Lucene Boolean operators control how terms are combined in queries
  • Boolean operators combine terms through logic operators
  • Lucene supports AND, "+", OR, NOT, and "-" as Boolean operators
  • Boolean operators must be written in ALL CAPS
  • OR is the default conjunction when no operator appears between two terms
  • OR matches a document if either term exists; || can replace OR
  • AND matches documents where both terms exist in the same document; && can replace AND
  • "+" requires the following term to exist somewhere in a field
  • NOT excludes documents containing the following term; ! can replace NOT
  • NOT cannot be used with only one term
  • "-" excludes documents containing the following term
  • Parentheses group clauses into subqueries to control Boolean logic
Feed/

Boolean Logic

No cover

Channel

Sahih el Boykhari

1 page

"Boolean operators allow terms to be combined through logic operators. Lucene supports AND, \"+\", OR, NOT and \"-\" as Boolean operators. Boolean operators must be ALL CAPS. The OR operator is the default conjunction operator, so if there is no Boolean operator between two terms, OR is used. The OR operator links two terms and finds a matching document if either term exists in a document; the symbol || can be used in place of OR. The AND operator matches documents where both terms exist anywhere in the text of a single document; the symbol && can be used in place of AND. The \"+\" or required operator requires that the term after the \"+\" symbol exist somewhere in a field of a single document. The NOT operator excludes documents that contain the term after NOT; the symbol ! can be used in place of NOT. The NOT operator cannot be used with just one term. The \"-\" or prohibit operator excludes documents that contain the term after the \"-\" symbol. Lucene also supports using parentheses to group clauses to form sub queries, which can be useful for controlling the Boolean logic for a query."

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.