功能分数查询以找到具有某些匹配分数的属性

时间:2019-02-03 04:12:21

标签: elasticsearch

我正在开发一个属性搜索工具作为我的业余爱好项目,以学习弹性搜索和基巴纳语。

以下是项目的详细信息:

Each property has these 6 attributes - Id, Latitude, Longitude, Price, Number of bedrooms, Number of bathrooms

用户可以根据以下四个参数进行搜索:

Distance - radius (high weightage)
Budget (high weightage)
Number of bedrooms (low weightage)
Number of bathrooms (Low weightage)

每个比赛都应有一个百分比,以指示比赛的质量。例如:如果一个物业完全符合上述所有4个限制条件的买家搜索要求,则该物业为100%匹配。

每个需求都有这9个属性-ID,纬度,经度,最低预算,最高预算,所需的最低卧室数,所需的最高卧室数,所需的最低浴室数,所需的最高浴室数。

功能要求

 1. All matches above 40% can only be considered useful.
 2. Requirements can be without a min or a max for the budget, bedroom and a bathroom but either min or max would be surely present.
 3. For a property and requirement to be considered a valid match, distance should be within 10 miles, the budget is +/- 25%, bedroom and bathroom should be +/- 2.
 4. If the distance is within 2 miles, distance contribution for the match percentage is fully 30%
 5. If the budget is within min and max budget, budget contribution for the match percentage is full 30%. If min or max is not given, +/- 10% budget is a full 30% match.
 6. If bedroom and bathroom fall between min and max, each will contribute full 20%. If min or max is not given, match percentage varies according to the value.

到目前为止我尝试过的事情
我评估了用例,并提出了功能评分查询方法,可以放置多个过滤器(例如地理位置,范围等),这些过滤器可以根据用户选择的参数值过滤出结果。
我还阅读了有关关系数据库的倒排索引方法。

问题
 1.弹性搜索是否适合这种用例?无论如何,我将用RDBMS编写数据并将弹性用于搜索查询,这种解决方案是否可以扩展到大量用户?

  1. 我应该在弹性查询中进行比赛得分计算吗? 那我怎么写这样的查询呢?这个example对我来说似乎很好, 我应该继续使用功能分数查询方法吗?

我需要什么 无论我是否朝着正确的方向发展,还有任何其他方法来处理这种用例,都能为我提供帮助吗?如果使用Elastic是正确的方法,那么如何编写这样的查询,就不需要完整的查询,但只要有一点点指导就可以完成解决方案。

0 个答案:

没有答案
相关问题