Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

Query syntax

Advanced queries give you the most flexibility in specifying what you want to search for. To build an advanced query, you use fields, which are categories of metadata that can appear on files. For example, an image file might have fields such as resolution, date_taken, and location.

This topic describes some of the ways you can create advanced queries. For more information, see the Apache Sol documentation at http://lucene.apache.org/solr.

NoteSome fields might not support all of these methods for building advanced queries.

Building an advanced query automatically

You can use the Search App to automatically build an advanced query using the fields listed under the Refine button.

In the Search App:

Procedure

  1. Click Refine.

  2. Click Add field.

  3. Select a field from the menu.

  4. Specify a value for the field.

  5. Click the Advanced link.

    The Search Console displays your query in the advanced query syntax.

Querying negative numbers

To query negative numbers, enclose the value in double quotation marks ("). For example:

temperature:"−273.15"

Basic format

The basic format for a query is:

field:value

For example, this expression finds files that have a field called title that has a value called Quarterly Report:

title:"Quarterly Report"

Combining search terms

To combine search terms, use the + and - operators. For example:

+sender:jsmith -recipient:mjones

The query returns files where the sender field is jsmith and the recipient field is not mjones.

Multiple values for a single field

This table shows the ways that you can search using multiple values for a single field.

FormatExampleDescription
field:(value value)sender:(jsmith mjones)Returns files where the sender field is either jsmith or mjones.
field:(+value +value)body:(+sales +"Widget Inc")Returns files where the body field includes both sales and Widget Inc.
field:(-value -value)date:(-august -september)Returns files where the date field includes neither august nor september.
field:(+value value -value)recipient:(+jsmith mjones -lstewart)Returns files where the recipient field includes both jsmith and mjones or only jsmith, but not lstewart.

Ranges

This table describes the formats you can use to search for a range of values.

FormatDescription
field:[start-value TO end-value]

Matches files that contain values in the specified range, including the start-value and end-value.

For example, this search term returns files where the author's name begins with A, B, C, or D:

author:[A* TO D*]

field:{start-value TO end-value}

Matches files that contain values in the specified range, excluding the start-value and end-value.

For example, this search term returns files where the author's name begins with B or C:

author:{A* TO D*}

Wildcards

This table describes the wildcard characters you can use in your queries.

CharacterDescription
?

Matches a single character.

For example, the search term ?at matches rat, hat, fat, etc.

*

Matches any number of consecutive characters, including none.

For example, the search term *day matches any of these:

  • day
  • Monday, Tuesday, Wednesday, etc.

Fuzzy search terms

Fuzzy searches return files that contain values similar to, but don't exactly match, the values you specify. To specify a fuzzy search term, insert a tilde (~) after a single-word search term.

For example, the search term red~ returns files that contain the word red, but also files that contain words like bed or beds.

Querying negative numbers

To query negative numbers, enclose the value in double quotation marks ("). For example:

temperature:"−273.15"

 

  • Was this article helpful?