Concept

Boolean Logic

Sahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) / Select Collections

"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."

Related Ideas

  • Boolean OperatorsSahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) · Select Collections
  • Search TermsSahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) · Select Collections
  • Search OperatorsSahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) · Select Collections
  • Search OperatorsSahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) · Select Collections
  • Search OperatorsSahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) · Select Collections
  • Search OperatorsSahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) · Select Collections
  • Search OperatorsSahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) · Select Collections
  • Search OperatorsSahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) · Select Collections
Boolean Logic | Sahih al-Bukhari - Sunnah.com - Sayings and Teachings of Prophet Muhammad (صلى الله عليه و سلم) | Bifalgorithm | Bifalgorithm