Why does Doofinder return different results when I search for "estanterías" and "estanterias"? Isn't Doofinder supposed to clean up those "special characters" in searches?
Let's talk about what happens when someone makes a spelling mistake when performing a search.
There are some filters that are applied to the words when processing the data. We'll consider two of them:
- Stemming: process where the root of the word is obtained.
- Character cleaning: some replacements are done, i.e. e instead of è, n instead of ñ, a instead of á…
In the index process the character cleaning is done after stemming. So, for instance, Spanish word estantería, is recognized as word in the dictionary and the stemming process takes the root estant, when character cleaning take place no special character is found.
Imagine someone mistypes this word and writes estanteria, which is wrong and doesn't belongs to Spanish dictionary. Stemming takes estanteri as root, which results in removing the a (feminine particle in Spanish).
The first root (estant) will match with more words than the second (estanteri). For instance, the first root will match with every item with the word estante, while the second won't.
The stemming is done before character cleaning because, if it is done after character cleaning a lot of words won't be recognized as Spanish words. In the example above, estantería would be cleaned to estanteria and stemming wouldn't recognize it.
To fix those cases where people usually mistype a word, synonyms could be used.
Though the behavior won't be exactly the same for the synonyms (cause there are some fields where synonyms are not applied), it will improve the results for those misspellings.
You take some steps further to understand your results:
When you’re getting unexpected results on the search, it’s important to check and improve your product feed and Search Fields configuration, as both components directly affect the quality of results given by the layer. How can you check that? We give you a few indications below.
Step 1: Verify in Results Preview
Go to: Admin Panel > Search > Results Preview > Search for your specific terms (e.g., “12v”, “50ah”)
Check the Query Type indicator below the search bar:
- If showing
match_ororfuzzy: Your content isn’t matching well enough with what is being searched.
Step 2: Inspect Your Product Feed
Go to: Admin Panel > Configuration > Search Engines > select engine > Indices.
Verify the data:
- Are “12v” and “50ah” present in your product data?
- Which fields contain these terms? (title, description, custom attributes?)
- Are they in separate fields or combined?
- Are those fields included in the Search Fields?
- You can also use the Results Preview to check if your product is showing and the data in it.
Example issues:
- Product title: “Battery” (missing voltage and capacity).
- Specifications are under long descriptions.
- Custom attributes like “voltage” not being indexed.
A quick fix would be to add specifications to product titles: “12v 50ah Battery”, that way you ensure the information searched is actually present on the data of your feed.
Best practices for your data feed:
- Keywords in shorter fields (title, short_descriptions or dedicated custom attributes) score higher.
- Structured data allows better matching.
- Doofinder can more easily find products with ALL terms.
Step 3: Check Field Name Mapping
Go to: Admin Panel > Configuration > Search Engines > select engine > 3 dots next to the indices name > Field Name Mapping
Verify:
- Custom attribute fields are properly mapped.
- Technical specifications are being indexed.
- All relevant fields are included (not excluded).
Example issues:
- Technical specs only in descriptions (it can lose relevance if long descriptions).
- Important attributes excluded from indexation.
Step 4: Search Fields Configuration
Go to: Admin Panel > Search > Advanced Preferences > Search Fields
Search Fields control which fields Doofinder searches in and how important each field is (weight 1-10).
Let’s check again our example “12v 50ah Battery”: If “12v” is in the title (field with less information and using high weight) and “50ah” is in the description (long informational field and low weight), Doofinder might not catch the correct product first.
Verify the data:
- Add technical specification fields to Search Fields, such as “voltage” and add them with appropriate weights.
- Test after changes:
- Go to Results Preview > Search for “12v 50ah” > Check if Query Type improved to match_and.
Step 5: Promotional Tools
If improving the feed isn’t immediately possible use the Promotional Tools to manually control results.
- Custom Results
When users search for a specific term such as “12v 50ah”, your selected products appear first, regardless of natural results.
Learn more: Custom Results
- Boosting Products
Boost products that have all terms, bury products with only some terms, this tool changes the relevance of products.
Learn more: Boosting
- Synonyms
It enhances your results by mapping terms from your feed to different terms of your choice, deriving then to a more accurate result.
Learn more: Synonyms
Always test your changes on the Results Preview, as this is updated immediately after saving configuration!
Note that the Promotional Tools aren’t indicated to resolve a high amount of product codes. In that case, you will need to review your indexed data instead, as informed before.
Testing your Search Engine
See how to test your search engine here!