Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Operator: Does Not Contain (!~)

Description

The does not contain operator allows you see if a text field does not contain a piece of text. The text can either be an unquoted single value, or a quoted value (in either double or single quotes) - normally you would use quotes around the string to make it clear you are searching for text.

The contains value supports the Lucene Query parser syntax as documented here

Text is indexed using the "Standard Analyzer" - this means that common words such as "a", "the", "this" etc. will not be indexed.

To return all values that do contain some text, use the Contains(!~) Operator.

Examples

Any records with a name not containing the word Test:

Code Block
languagenone
Name !~ Test

Any records where the name does not contain either "defect" or "bug"

Code Block
languagenone
Name !~ "defect bug"

An records where the name does not contain the value:

Code Block
languagenone
Name !~ "'change password to invalid value'"

Any records where the name does not contain any word matching the single letter wild card (would exclude records where the field contains the text, test etc):

Code Block
languagenone
Name !~ "te?t"  

Any records where the name does not contain a word start with the text "log" (would exclude log, logging logged etc.)

Code Block
languagenone
Name !~ "log*"

Long-hand form of the operator:

Code Block
languagenone
Name DOES NOT CONTAIN "log"

Notes

There is a special field Text which you can search against will expand to search against all fields support the operator "does not contain".

Here is example of it's usage to find any records where they contain the text "exception":

Code Block
languagenone
Text !~ "exception"