例如,如果他们希望搜索结果中出现没有 Adventure 一词的结果,他们是否可以键入“-Adventure”?
最佳答案
肯定的事!您需要启用 advancedSyntax feature然后是 -
前面的话会被解释为NOT
.
index.search('Crazy -Adventure', { advancedSyntax: true }).then(...);
将搜索所有带有
Crazy
的对象并且没有 Adventure
.
关于algolia - 用户可以在搜索结果中排除关键字吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41108695/