简体   繁体   中英

Search for exact term in an Algolia index

I want to filter an index by an exact value of an attribute. I wonder what possibilities Algolia offers for that.

Querying an index always results in a search for substrings, that means a search term abc will always match any object which attribute values contain abc . What I want to achieve is a search for abc that finds only abc as a value of an attribute (in this case I have specific attributes to search in).

One possibility I came up with was tagging, which doesn't seem to be the best way to think of.

Edit

I think I could also use facet filters. I thought about the different pros and cons and can't come up with arguments that places either one position above the other.

You're right with your edit that facet filters would be the way to go on this one. You'll get the exact match you're looking for and won't have to create a new attribute of _tags to use the tag filter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM