TextQuery document (Data API 18.2)

A text query is used to match some text (i.e. a search phrase possibly consisting of multiple terms) against one or multiple fields. In case multiple fields are provided, the phrase conceptually forms a logical OR over the fields. In this case, the terms of the phrase basically have to match within the text, that would result in concatenating all given fields.

Example: (coupon_id contains "xmas" )
    query: {
        text_query: {
            fields: ["coupon_id"],
            search_phrase: "xmas"
        }
    }
 
Example: (coupon_id contains "xmas" OR description contains "xmas")
    query: {
        text_query: {
            fields: ["description", "coupon_id"],
            search_phrase: "xmas"
        }
    }
 
Example: (description contains "holiday" AND description contains "bojo")
    query: {
        text_query: {
            fields: ["description"],
            search_phrase: "holiday bogo"
        }
    }
 
Property Type Constraints Description
fields [String] mandatory=true, minItems=1, nullable=false The document fields the search phrase has to match against.
search_phrase String mandatory=true, nullable=false A search phrase, which may consist of multiple terms.
OCAPI obsolete versions 13.x and 14.x will be end of life in 2020 and versions 15.x and 16.x in 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.