Snippet helper on attribute with no match #5018
-
My search has queryBy set on 3 attributes in my index, so my UI displays all three of these attributes in a hit. Two are short and I use the highlight helper, the 3rd is very long so I only display a snippet using the snippet helper. My problemIf the match comes from either of the first two attributes, that third attribute is displayed in full, no snippet. Of course it works fine when the hit is actually on the snippeted attribute--what is displayed is just the short snippet. What I'm trying to doI'd like to set a minimum amount of text to display for that third attribute (the one I've wrapped in the snippet helper) for when the hits are originating from the other attributes. Can someone help me see how to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Is it possible you're using a different search engine than Algolia? By default Algolia will always show the number of words you specify, even if there's no match in the word: https://codesandbox.io/s/confident-ives-ofjs4m?file=/src/app.js |
Beta Was this translation helpful? Give feedback.
Is it possible you're using a different search engine than Algolia? By default Algolia will always show the number of words you specify, even if there's no match in the word: https://codesandbox.io/s/confident-ives-ofjs4m?file=/src/app.js