Skip to content

Latest commit

 

History

History
177 lines (130 loc) · 3.59 KB

query-operators.md

File metadata and controls

177 lines (130 loc) · 3.59 KB
copyright lastupdated
years
2015, 2017
2017-10-09

{:shortdesc: .shortdesc} {:new_window: target="_blank"} {:tip: .tip} {:pre: .pre} {:codeblock: .codeblock} {:screen: .screen} {:javascript: .ph data-hd-programlang='javascript'} {:java: .ph data-hd-programlang='java'} {:python: .ph data-hd-programlang='python'} {:swift: .ph data-hd-programlang='swift'}

Query operators

{: #query-operators}

Operators are the separators between different parts of a query. For the complete list of available operators, see the Query reference.

. [JSON delimiter]

{: #delimiter}

This delimiter separates the levels of hierarchy in the JSON schema

For example:

enriched_text.concepts.text

{: codeblock}

: [Includes]

{: #includes}

This operator specifies a match for the query term.

For example:

enriched_text.concepts.text:cloud computing

{: codeblock}

:: [Exact match]

{: #match}

This operator specifies an exact match for the query term.

For example:

enriched_text.concepts.text::cloud computing

{: codeblock}

:! [Does not include]

{: #notinclude}

This operator specifies that the results do not contain a match for the query term

For example:

enriched_text.concepts.text:!cloud computing

{: codeblock}

::! [Not an exact match]

{: #notamatch}

This operator specifies that the results do not exactly match the query term

For example:

enriched_text.concepts.text::!cloud computing

{: codeblock}

\ [Escape character]

{: #escape}

Escape character for queries that require the ability to query terms by using string literals that contain control characters.

For example:

enriched_text.concepts.text:\!cloud computing

{: codeblock}

"" [Phrase query]

{: #phrase}

All contents of a phrase query are processed as escaped. So no special characters within a phrase query are parsed, except for double quotes (") inside a phrase query, which must be escaped (\"). Use phrase queries with full-text, rank-based queries, and not with boolean filter operations. Do not use wildcards (*) in phrase queries. Note: single quotes (') are not supported.)

For example:

enriched_text.concepts.text:"IBM watson"

{: codeblock}

(), [] [Nested grouping]

{: #nestedquery}

Logical groupings can be formed to specify more specific information.

For example:

filter-entities:(text:IBM,type:Company)

{: codeblock}

| [or]

{: #or}

Boolean operator for "or".

For example:

query-enriched.entities.text:Google|IBM

{: codeblock}

, [and]

{: #and}

Boolean operator for "and".

For example:

query-enriched.entities.text:Google,IBM

{: codeblock}

<=, >=, >, < [Numerical comparisons]

{: #comparisons}

Creates numerical comparisons of less than or equal to, greater than or equal to, greater than, and less than.

For example:

`enriched_text.sentiment.document.score>0.679`

{: codeblock}

^x [Score multiplier]

{: #multiplier}

Increases the score value of a search term.

For example:

query-enriched_text.concepts.text:IBM^3

{: codeblock}

* [Wildcard]

{: #Wildcard}

Matches unknown characters in a search expression.

For example:

query-enriched_text.concepts.text:IBM*

{: codeblock}

~n [String variation]

{: #variation}

The number of one character changes that need to be made to one string to make it the same as another string. For example car~1 will match car,cap,cat,can, etc..

For example:

query-enriched_text.concepts.text:Watson~3

{: codeblock}