Using Wildcards in Text Searches

You can use the * (asterisk) wildcard operator to perform prefix matching. The * operator only applies to individual terms. When you append the * operator to a string, the string is treated as a prefix. ASN Search matches results that contain the prefix followed by zero or more characters. If you're searching a text field, the matched prefix can occur anywhere within the contents of the field. You can also use the wildcard operator to perform "starts with" searches in literal fields. For more information, see the section Using Wildcards in Literal Searches.

Note
When performing wildcard searches on text fields, keep in mind that ASN Search tokenizes the text fields during initial indexing and peforms basic text processing such as removing the trailing s from plural terms. Normally, the same text processing is performed on the search query. However, when you use the wildcard operator, no text processing is performed on the prefix. This means that a search for a prefix that ends in "s" won't match the singular version of the term. This can happen for any term that ends in s, not just plurals. For example, if you search the description field for "Calculators", there are 985 matching items. If you search for "Calculator*", you get the same 985 items. However, if you search for "Calculators*" there are no matches. This is because the term is stored in the index as "Calculator", "Calculators" does not appear in the index.

For example, the following Boolean query searches the description field for the prefix longitu:

../search?bq=description:'longitu*'&return-fields=description

If you perform this search the response will contain items such as longitudinal, longitude.

{"rank":"-text_relevance",
"match-expr":"(label description:'longitu*')",
"hits":{"found":184,"start":0,
   "hit":[
      {"id":"s2371570","data":{"description":[" Distinguish longitudinal waves from transverse waves."]}},
      {"id":"s1139909","data":{"description":["Use latitude and longitude to locate places."]}},
      ...
   ]
 }, 
 "info":{
    "rid":"8a0620f6c72ff3e73c2a10e59f186fa89ba1fa67e3b160548fb2c7aa91bce7aebdc0b87198cf138a",
    "time-ms":3,
    "cpu-time-ms":0
}}