我的Solr索引有两种类型的用户( Type-A和Type-B ),它们可以用一个名为“type”的字段标识。但是用户有可能在这两种类型(A和B)下都有条目。
例如,
Jacob is a user who comes under both Types(A and B). So, he will have two documents in our Index like:
//document-1
name:...
type:A
age:...
//end of document-1
//document-2
name:...
Type:B
age:...
//end of document-2我的目标是,
我们如何通过查询实现这一点?
提前感谢!
发布于 2012-09-15 09:41:55
我假设您有一些字段可以唯一地识别用户?比如名字还是空客?如果是这样,只需使用分组按该字段分组即可。如果您设置了group.main=true,那么结果将与没有使用分组的结果没有什么不同。
https://stackoverflow.com/questions/12424517
复制相似问题