简体   繁体   English

在Algolia指数中搜索确切的术语

[英]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. 我想知道Algolia为此提供了哪些可能性。

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 . 查询索引总是导致搜索子字符串,这意味着搜索项abc将始终匹配属性值包含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). 我想要实现的是搜索abc ,它只找到abc作为属性的值(在这种情况下,我有搜索的特定属性)。

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. 我想我也可以使用facet过滤器。 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. 您将获得您正在寻找的完全匹配,并且不必创建_tags的新属性来使用标记过滤器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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