January 2, 2021
Estimated Post Reading Time ~

Increasing Desired Search Results with Oak Indexing Analyzer

Oak Index Analyzer provides attributes that help in boosting search to get the desired results. The way it works is that each of the indexes can be defined with analyzer nodes with properties defined on them. When the re-index happens, the analyzer nodes control the way the indexes are created and help the queries fetch more accurate results.

Stemming
In JCR Query, any full-text search uses the equivalent match for the given word. This may not deliver all the desired results a user wants to see, even though the content is present in the repository. Stemming helps to avoid that by providing a linguistic-like search based on the words given. For example: When stemming is provided on the index, the word “sleeve” will fetch results that have words like “sleeved.”

Before applying PorterStem, the search for the word “sleeve” fetches five results. It only fetches nodes matching the exact word “sleeve.” See the result below image.



(Click images to enlarge them)

After applying PorterStem, the search for the same word “sleeve” fetches nine results. It fetches nodes that match both words “sleeve” and “sleeved.” See the result below image.



Synonyms
Computer search results will display only the text with an exact match in the full-text search. This may not be the desired result for companies to make the end-user stay on the website. This technical difficulty is eliminated by the Synonyms configuration on the index. In the configuration, we can map two words to be synonymous with each other; when a search is done with one word, it will return combined results for both words.

See the below image for a search of the word “Jacket” before configuration.



See the below image for a search of the word “Jacket” after synonym configuration, which results both “jacket” and “coat.”



Stop Word
In the real world, there are situations where don’t have to index for blacklisted words, thus avoiding them from the search results. Mostly like profanity words. Stop Word configuration on index helps us to do this.

See the below image, assuming the word “retail” as a blacklisted word before stop word configuration.



See the below image, assuming the word “retail” as a blacklisted word, after Stop Word configuration.





By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.