In this tutorial we will discuss the use of wildcards in text searching and their potential to maximize the effectiveness of your searches in the Lens.
Wildcards are simply symbols used in a search term to replace one or multiple characters. While different search engines use wildcards differently, the two most common wildcards used are ? and *
The “?” (question mark) symbol is used to represent a single character, anywhere in the word. It’s most useful when there are variable spellings for a word, and you want to search for all variants at once. To take an example, if you are searching in the field “title” for “next” or “nest” terms, by simply using ? in the place of X , you would be able to capture all the variants of this term. In the search results page, you can now find not only next with an X but also variants of the word nest such as “Nesting”. This is mainly because in the Lens, the search engine takes into consideration the root form of a word.
The second symbol used is the “*” (asterisk) and it is used to specify multiple characters in a search term. Typically, it is used at the end of a stem word and it is then referred to as “truncation.” This is most useful when you want to search for variable endings of a stem word (treat*), or concepts with similar spelling, plurals, or misspelled words. To take an example, let us compare searching for
Title: treatment cancer to the search for Title: treat* with an asterisk and cancer. In this search results page, you will see that most all the titles start or end with the word “treatment”. If we trim this word to the root form “treat” and add the wildcard symbol * and look at this new search results, not only that we are able to capture more results but also capture titles with variable endings to the root word “treat” such as treating and treatment.
Now, as you may have already observed, wildcard queries are used as part of single terms NOT phrases,
here are some basic query rules for wildcards to remember
Wildcards symbols are ignored in phrases. If you use a phrase to search for “treat* cancer”, the wildcard will be ignored,
Wildcards can NOT be used as the first character of the search term ‘*eat’
Wildcard terms are not stemmed. So, if you use the term treating* ( with the wildcard *), you would only match words which start with treating and that have NOT been stemmed to the word treat. Instead you will find words or typos such as treating1 or any additional term attached to word treating.
Now because in the Lens, search terms are stemmed by default (showing that stemming is on and the use of wildcards is therefore unintuitive, we have prepared a tutorial in the Support center under text searches with examples to show you what to expect when using wildcard queries if the lens search index stemming is ON or OFF.
In this table (shift to the second tab and show the table in support center), you can view the various wildcard queries we considered, the results based on whether the stemming in on or off with the link page to the results plus an explanation on how the search was performed.
So, we hope that this demo and the examples will help you conduct effective searches in the Lens using wildcards. Please make sure that you are logged in to save your queries and export larger number of documents. If you have any feedback/question, email: email@example.com or firstname.lastname@example.org Thank you