Last updated on
16 May 2021
|
Also applies to Communiqué
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
- Connect to your instance via CQDE
- 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> - 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> - 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.
- Save /config/repository/search/fulltexthandler.xml.
- Stop your instance.
- Delete folder cq_home/data/your_instance/search/fulltext.
- Start your instance.
Download
Note:
Restart can take some time depending on your content size, since Lucene reindexes the content.