Why Stopwords?

The SearchStax Site Search solution honors the search industry’s use of stopwords to help focus website search results. Stopwords are common words that should be ignored when evaluating a query because they dilute the relevance of the results.

Note: Stopwords apply only to tokenized (full-text) search fields. They don't affect fields indexed as non-tokenized strings. Tokenized fields split text into terms so queries can match individual terms. For consistent results, include at least one tokenized field in your Search Fields list, and make sure the fields you expect stopwords to affect are tokenized. In Drupal, you can set a field's data type to Fulltext to make it a full-text field.

Stopwords Example

If we search the SearchStax document collection for the keywords “sort rank” we get 28 hits.

Search query bar and results count showing

That’s 28 documents that contain either sort OR rank (or both).

If we search for sort and rank we get about ten times as many hits:

Search results header showing 313 documents found for the exact phrase

The pages containing sort or rank are buried among all the pages that contain and. A naive user might have trouble finding the useful pages in the results list.

To alleviate this situation, we go to Site Search > Configurations > Basic Configurations > Stopwords and add “and” to the list of stopwords.

Stopwords configuration interface showing common words like

After publishing the stopwords list, and refreshing the Hosted Search App, the same search remains focused on sort OR rank content. We’re back to 28 hits again.

Results counter showing 28 matches found when searching for

This is the benefit of stopwords in keyword search.

Stopword Lists

By default, Site Search has no stopwords configured out of the box. Why is that?

Site Search supports multi-language experiences, meaning you can index documents or webpages in over forty languages. Stopwords are language-specific, so SearchStax leaves that step to you.

Stopword lists can be found on the Internet, but they are also available in searchstax-client-master.zip, a downloadable file we provide as a source for the Zookeeper Command Line Interface (zkcli.exe).

Download this file (about 280 MB) and go to one of the >searchstax-client-master\solr-n\configsets\_default\conf\lang subdirectories. Look for stopword files named using ISO 639 language codes.

File browser showing stopwords_en.txt location within the searchstax-client-master.zip directory structure.

You might need to edit the file to remove the #comments at the beginning. Then, return to the Stopwords screen to load the file into Site Search.

Stopwords configuration interface showing text input for manual entry and file upload options, with common words like

Remember to click the Publish button at the bottom of the screen to load the list into Solr.

Articles in this section