Appearance
Best Practices for Search Rules
By default, Relewise attempts to handle all search terms out of the box through the use of Natural Language Processing, which helps flatten and streamline searches into more easily parsable terms. However, there may be situations where the engine needs a helping hand, such as for words that are related in ways not obviously reflected by the entity data. Enter Synonyms and Search Term Modifiers
Use Sparingly
Search rules such as Synonyms and Search Term Modifiers are meant to be used sparingly, for such situations where the entity data itself does not adequately cover the use case. However, it is always our strongest recommendation that you try to update and amend your entity data in such a way that these explicit fixes are not necessary.
For instance, adding a data key for tags or searchKeywords is a much more performant, durable and reliable method of ensuring that entities can be found in your search than creating a myriad of rules to bridge the gap between search term and desired outcome. It is particularly useful for those situations where you might have a dozen different scattershot terms that all apply to a given product. Rather than creating a rule for every single word, and trying to connect those with other extant keywords, adding them to the entity itself helps the engine more accurately identify the entity as relevant.
Using entity data rather than a search rule also benefits the accuracy of the search because a search rule, by its very nature, is global across all of your entities, which can lead to false positives as often as not.
Synonyms vs. Search Term Modifiers
By default, you should attempt to use a synonym rather than a search term modifier. Synonyms are easier to work with and tend to be more predictable in their outcomes, whereas a search term modifier can be more prone to causing havoc if implemented poorly. Certain situations do not allow for the use of synonyms, however, or may benefit from the more nuanced touch that a search term modifier can offer.
The chief differences between the two are outlined below:
Synonyms:
- Do not support spaces. This means that you cannot reliably use synonyms for languages that break compound words into multiple segments, such as is the case with English.
- Compare
dog housein English withHundehüttein German
- Compare
- Useful for increasing the number of hits that a search will return. A synonym from
tablettoipadwill ensure that a search fortablethas more results, because it also includes hits for iPad-only products now. - Globally affects entities, without the possibility of further refinement. This is useful for addressing things like abbreviations and shorthand (
dinotodinosaur) that may be relevant across your entity portfolio.
Search Term Modifiers:
- Supports spaces in words, which allows you to refine searches using compound words that are broken up (e.g.
dog house). - Useful for altering a search to be more accurate. While synonyms add to the number of search results, a search term modifier is capable of changing the search to hit much more narrowly as the case requires.
- Capable of being more narrowly defined, and only affecting specific instances, e.g. "modify the search term when it starts with [term]".