Optimize search by adding stop words

Issue

You want to implement a stop word list to optimize your search index. In this case, the use of the full-text Lucene handler to index /content is assumed. If you are using a standard search index, then use the appropriate configuration files accordingly.

Solution

  1. Connect to your instance via CQDE
  2. Open page /config/repository/search/fulltexthandler.xml. By default, it looks like the following:
    <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE searchhandler SYSTEM "cq:/system/resources/dtd/contentbus/search/fulltexthandler.dtd"> <searchhandler> <index location="search/fulltext" maxFieldLength="10000" resultCacheSize="50" useCompoundFile="true" /> </searchhandler>
  3. Add your stop words to this file like the following:
    <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE searchhandler SYSTEM "cq:/system/resources/dtd/contentbus/search/fulltexthandler.dtd"> <searchhandler> <index location="search/fulltext" maxFieldLength="10000" resultCacheSize="50" useCompoundFile="true" /> <stop-list> <stop-word>and</stop-word> <stop-word>or</stop-word> </stop-list> </searchhandler>
  4. You can use the zip file attached as the list of stop words, generate your own list, or find another stop word list from Internet.
  5. Save /config/repository/search/fulltexthandler.xml.
  6. Stop your instance.
  7. Delete folder cq_home/data/your_instance/search/fulltext.
  8. Start your instance.

Download

Note:

Restart can take some time depending on your content size, since Lucene reindexes the content.

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online