Grouping documents in solr

人走茶凉 提交于 2019-12-13 19:59:47

问题


I want to index orders and corresponding order entries in Solr to display it in our e-commerce site.

I am planning to adopt a De-normalized approach by repeating order details with every order entries to reduce request latency. But at the same time I need to group records by orderid to find order total for a specified duration.

Is it possible to achieve this without going for a separate index for orders alone?


回答1:


Yes this is possible, you can user Result Grouping / Field Collapsing for your query. In your case the group field should be orderid and you should add group=true&group.field=orderid to your request to Solr to enable this feature.



来源:https://stackoverflow.com/questions/33403910/grouping-documents-in-solr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!