Basic Search Augmentations In Reveal

This article provides a detailed description of all the features and options associated with basic search syntax


Reveal offers a rich palette of methods to search, filter and identify data. This article addresses the use of basic search enhancement features available while you are scaling up your Reveal knowledge.

Connectors are logical operators which facilitate searching of multiple terms in relation to each other. Boolean expressions are true or false depending on whether the relationship between the search terms exists within the document or data.

Wildcard search is an additional technique that can be used to maximize your search results. Wildcards are used in search terms to represent one or more other characters and to expand the collection of documents returned by a search term.

In addition to wildcards, there is an option search for words in Proximity to other words, which returns only documents where the terms are found within a specified number of words or alphanumeric strings.

This document discusses syntax that is specific to Elastic (Lucene) query syntax. For a more in-depth discussion of Reveal search syntax, please see Reveal Query Language.

Connectors

Allow you to combine or connect search criteria, and also exclude certain search criteria. Criteria may include search terms (words, alphanumeric strings) or combinations of terms using connectors or proximity operators within parentheses.

  • AND returns documents or records where all connected terms specified in the expression are found. E.g., dog AND cat returns documents containing reference to BOTH domestic pet species.
  • OR returns documents or records where any connected term specified in the expression is found. E.g., dog OR cat returns documents containing reference to either domestic pet species; this connector will therefore normally cause the search to return more documents.
  • NOT is used in several different ways:
    • AND NOT returns documents or records where one connected term in the expression is found to the exclusion of the other, e.g., cats AND NOT dogs would retrieve all documents referencing only cats.
    • OR NOT returns documents or records where either the first connected term in the expression is found or the negative expression is not found, e.g., cats OR NOT dogs would retrieve all documents either referencing cats or not referencing dogs.
    • NOT <term> is a “unary NOT” – the string <term> is not found in the document metadata, e.g., NOT dogs would retrieve all documents that do not reference dogs.
    • NOTE: cats NOT dogs is not valid syntax in Reveal.

Syntax notes:

    • HAS <fieldname> is used to match documents where the specified metadata field is non-null and non-empty (for HAS Subject the field “Subject” must contain some value).
    • NOT HAS <fieldname> is used to match documents where the specified metadata field is null and empty (for NOT HAS Subject the field “Subject” must contain no value).
    • Grouping: Parentheses are used to define clauses of terms and operators. Multiple terms or clauses can be grouped together with parentheses, to form sub-queries: (quick OR brown) AND fox. This is particularly important in specifying the logic of expressions combining different connectors.
    • Phrases require surrounding quotes ("). A multi-word phrase without quotation marks will not be accepted as a valid search.
    • Precedence of operators – considered in order:

Operator Precedence - Highest to Lowest

()

HAS, IN, REGEX

W/N, PRE/N, NOT W/N, NOT PRE/N

<, >, <=, >=

EXACT

NOT, EXPAND

AND

OR

Wildcards

  • The * wildcard can be used to replace zero or more characters in a search, and find stems of the word.

Leading wildcards in a search term are not supported in Standard query syntax because of their impact on performance.

Examples:

  • R*d bro* to find red brochure or read brother or railroad broken, for example.
  • Bett* to find Bett, Betty, Bettie, Bettey, Bette (but will also find better and other words that stem from Bett).
  • Me*ts will find Mets, Meats, Melts or Megawatts, for example.
  • Leading wildcards are not supported.

Proximity

Allows you to search for a set of words or a phrase within a certain number of words, using the Standard query syntax w/ as a proximity indicator followed by the maximum number of words (or space-separated strings) intervening. If more than one word is to be used in a term, be sure to put the words to be searched inside of quotation marks. An ordered syntax specifying one term preceding the other may be expressed using PRE/#.

Examples:

  • fox w/5 quick finds fox within 5 words of quick in either direction.
  • Staci w/2 Otto finds Staci Otto, Staci Noreen Otto or Staci N. Otto (where punctuation is treated as a word).
  • Agreement w/2 Letter finds agreement letter, letter of agreement (not order specific).
  • Agreement PRE/0 Letter finds agreement letter with no words intervening.
  • Agreement PRE/2 Letter finds agreement letter, agreement by letter, agreement in a letter in specific order.

For more information on using Reveal Query Language please see Reveal Query Language Basics and Reveal Query Language.

 

Last Updated 6/03/2024