Elasticsearch/ Searchkick gem - 提升字段不会 return 结果带有特殊字符(例如撇号)
Elasticsearch/ Searchkick gem - boosting fields do not return results with special characters (e.g. apostrophes)
我们在我们的应用程序中使用 searchkick gem 并且有许多文档的字段包含特殊字符,例如撇号,例如title
Valentine's Day Special
.
的报价
没有助推器,搜索 Valentines
或 Valentine's
或 Valentine
将 return 正确的搜索结果:
Activity.search "Valentines"
但是,如果合并标题字段的助推器,则搜索上述任何查询都不会 return Valentine's Day Special
结果。
Activity.search "Valentines", fields: ["title^10"]
我一直在尝试通过 Elasticsearch/Searckick 文档进行故障排除,但尚未找到解决方案。还有其他人遇到过这个问题吗?
通过部分工作匹配解决方法解决了此问题:
Offer.search("Valentine's", fields: ["name"], match: :word_middle)
我们在我们的应用程序中使用 searchkick gem 并且有许多文档的字段包含特殊字符,例如撇号,例如title
Valentine's Day Special
.
没有助推器,搜索 Valentines
或 Valentine's
或 Valentine
将 return 正确的搜索结果:
Activity.search "Valentines"
但是,如果合并标题字段的助推器,则搜索上述任何查询都不会 return Valentine's Day Special
结果。
Activity.search "Valentines", fields: ["title^10"]
我一直在尝试通过 Elasticsearch/Searckick 文档进行故障排除,但尚未找到解决方案。还有其他人遇到过这个问题吗?
通过部分工作匹配解决方法解决了此问题:
Offer.search("Valentine's", fields: ["name"], match: :word_middle)