Term and Phrase Search

DSE Version: 6.0

Video

Transcript: 

In search, there are terms and phrases where search queries that can take operation of both.

Slide 22 - CQL Search Request (Move to Previous Section)

  • A CQL query that includes the solr_query column in the WHERE clause

    • Uses only the = operator

    • The column value is a string containing the Lucene search expression

  • Most, but not all, CQL predicates are still valid in a search request

    • Selecting columns

    • WHERE predicates

    • Limiting the number of rows

  • Does not work with other DML statements - INSERT, UPDATE, DELETE

Search Term

  • Search for a term using the following format - field:term

    • The field / column name goes into the field

    • The value you're searching for in the field goes in term. Can be a word and Can also be a numerical value but the correct field type must be set on the field.

  • Use the special syntax *:* to retrieve all of the documents

Examples

  • To retrieve all documents

  • To retrieve all documents whose specific field is not null

  • To retrieve documents where a field matches a specific term

Phrase

  • An entire phrase can be searched in a field

  • The field value must match the terms in the same order

  • Use double-quotes to denote a phrase

  • Important to note that phrases and wild cards can not be used in conjunction.

Multiple Terms in a field

  • Use parentheses to make a grouping of terms - (  )

  • Return documents whose title matches any of the search terms

Searching multiple fields

  • Multiple fields can be searched using the format - field:term  field:term …

  • Results include rows that match any of the field:term combinations

Boolean Ops

  • Allows terms to be combined into unique and flexible conditional search expressions

  • Add to or limit the documents that get returned in the search results

  • Grouping can be used to further control the results

Required

  • Added at the beginning of a term or phrase

  • The term is required to be in the document field

  • Required term is processed regardless of other Boolean operators

Prohibit

  • Add at the beginning of a field, term or phrase

  • Excludes documents that match the prohibited term

  • The prohibited term is processed regardless of other Boolean operators

Not

  • Similar to prohibit, and will exclude documents that matches the following term

Group

  • Enclose multiple terms within parentheses to create sub-queries

  • Groups can be chained with a Boolean operator to expand the query

  • Multiple terms grouped together without an operator defaults to the Boolean OR

TS

  • XML schema specification format - YYYY-MM-DDThh:mm:ss.SSSZ

  • UTC is default time zone

  • ms is optional

Now let’s try and put our new found knowledge of terms, phrases and forming CQL search requests into action with an exercise.

No write up.
No Exercises.
No FAQs.
No resources.
Comments are closed.