简体   繁体   English

使用Solr进行成本比较

[英]Cost comparison using Solr

I plan to build something like pricegrabber.com/google product search. 我打算建立类似pricegrabber.com/google产品搜索的内容。

Assume I already have the data available in a huge table. 假设我已经有一个巨大的表中的数据。 I plan to submit this all to Solr. 我打算将所有内容提交给Solr。 This solves the problem of search. 这样解决了搜索问题。 However I am not sure how to do comparison. 但是我不确定如何进行比较。 I can do a group by query(on UPC/SKU) for the products returned by Solr on the DB. 我可以通过查询(在UPC / SKU上)对Solr在数据库上返回的产品进行分组。 However, I dont want to do that. 但是,我不想这样做。 I want to somehow get product comparison data returned to me along with search from Solr itself. 我想以某种方式获得产品比较数据以及Solr本身的搜索结果。

How do you think should my schema be? 您如何看待我的架构? Do you think this use-case can be solved all by Solr/Sphinx? 您认为Solr / Sphinx可以解决所有用例吗?

You need 'result grouping' or 'field collapsing' support to properly handle it. 您需要“结果分组”或“字段折叠”支持才能正确处理。

In Solr , the feature is not available in any release version and is still under development. Solr中 ,该功能在任何发行版本中均不可用,并且仍在开发中。 If you are willing to use an unreleased version of Solr, then get the details here . 如果您愿意使用未发行的Solr版本,请在此处获取详细信息。

Sphinx supports result grouping and I had used it a long time ago in a similar project. Sphinx支持结果分组,而我很久以前就在类似的项目中使用过它。 You can get more details here . 您可以在此处获得更多详细信息。

An alternative strategy could be to preprocess your data so that only a single record per UPC/SKU gets inserted in the index. 另一种策略是预处理数据,以便每个UPC / SKU仅插入一条记录到索引中。 Each record can have a separate field containing the ids of all the items with the same UPC/SKU. 每个记录可以有一个单独的字段,其中包含具有相同UPC / SKU的所有项目的ID。

Doing a database GROUP BY on the products returned by Solr may not be enough. 对Solr返回的产品进行数据库GROUP BY可能还不够。 For example, if products A and B have the same UPC and a certain query matches A but not B, then you will not get both A and B in your result set. 例如,如果产品A和B具有相同的UPC,并且某个查询与A匹配但与B不匹配,则结果集中将不会同时获得A和B。

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

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