本文介绍了索引类型增强的多字段自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在高层次上完成的是一个自动填写输入字段,可以查询客户和多个字段的订单,客户名称搜索排名较高。

What I'm trying to accomplish on a high level is an autocomplete input field which queries both customers and orders on multiple fields, with customers ranking higher for customer name searches.

在我看来,有几种方法可以使用弹性搜索提供的工具来解决这个问题。

It seems to me that there are various ways to approach this problem with the tools that elasticsearch provides.

我已经接近的方法是使用 multi_match 查询与 prefix_phrase 类型,以获得部分查询工作跨多个字段。

The way that I have approached this is to use multi_match queries with prefix_phrase type in order to get partial queries to work across multiple fields.

例如,bo应该返回匹配Bob Smith以及Adam Boss。我将全名作为与名字和姓氏的单独字段进行索引,所以adam老板也会返回一个有效的前缀匹配。

For example, "bo" should return back matches for "Bob Smith" as well as "Adam Boss". I'm indexing fullname as a separate field from firstname and lastname, so that "adam boss" will return a valid prefix match as well.

此外,我会喜欢提高客户效果 - 尝试使用,但这似乎没有像我期望的那样工作。

In addition, I'd like to boost customer results - trying to do that with a boost param on the multi_match, but that doesn't seem to be working the way I'd expect it to.

什么是直接的解决这个问题的方法?

What would be a straight forward way to tackle this problem?

我在弹性搜索文档中面临的一个挑战是,并不总是清楚哪些属性和功能适用于哪些其他的。例如,

这篇关于索引类型增强的多字段自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 14:24