Skip to content

Search Syntax Using Dismax Or

Kevin Day edited this page Feb 15, 2023 · 9 revisions

This follows a simple phrase based search process that does not support wild cards.

Search Features

  • Use + or - to denote mandatory or prohibited matches of a given phrase.
  • Use quotes to group phrases for more precise matching, such as "word1 word2".
  • Searches are case-insensitive such that upper and lower case letters are treated as indistinguishable, except for AND and OR special use words.
  • Each space separated word or phrase is automatically combined using an AND condition except when the following word or phrase does not have a leading + or - or except when AND is explicitly specified between words.
  • Explicitly add either the word AND (all upper-case) or the word OR (all upper-case) between each space separated word to override the default combining condition.
  • Trailing punctuation is generally ignored when matching and can be omitted (for example, Center, and Center should be treated as the same search).
  • This does not support boosting, for example word^1.0 has no meaning and attempts to match word^1.0 rather than word.
  • The following characters may have special meaning and may need to be escaped for literal matching using the escape character \: + - \.

Examples

Consider the following titles:

  • My Apple
  • My Red Apple
  • Red Apple
  • Blue Apple
  • My Orange
  • Yellow Banana
  • My red hat is covering up an apple.

Using a search of my apple should produce:

  • My Apple
  • My Red Apple
  • Red Apple
  • Blue Apple
  • My Orange
  • My red hat is covering up an apple.

Using a search of my^2.0 apple^1.0 should produce:

  • no results

Using a search of "my apple" should produce:

  • My Apple
  • My Red Apple
  • Red Apple
  • Blue Apple
  • My Orange
  • My red hat is covering up an apple.

Using a search of +my apple should produce:

  • My Apple
  • My Red Apple
  • Red Apple
  • Blue Apple
  • My Orange
  • My red hat is covering up an apple.

Using a search of +my +apple should produce:

  • My Apple
  • My Red Apple
  • Red Apple
  • Blue Apple
  • My Orange
  • My red hat is covering up an apple.

Using a search of +my -red +apple should produce:

  • My Apple
  • Blue Apple
  • My Orange

Using a search of +my +red -apple should produce:

  • no results

Using a search of +my -red -apple should produce:

  • My Orange

Using a search of -apple should produce:

  • My Orange
  • Yellow Banana

Using a search of "red apple" should produce:

  • My Red Apple
  • Red Apple