solr查询 - 数组至少具有一个值,而不是在特定列表中
我需要一种过滤查询的方法,以获取包含至少一个值不在特定列表中的数组的文档。
例如:
{
id:1,
field:["dog", "cat", "bird"]
},
{
id:2,
field:["cat", "bird"]
},
{
id:3,
field:["bird"]
}
我想过滤文档,其中包含至少一个值,而不是“猫”和“鸟”。 预期结果:
{
id:1,
field:["dog", "cat", "bird"]
}
我发现了这个类似的问题,但是答案似乎仅适用于整数值: solr查询要过滤文档在数组中至少具有一个值的文档,但指定值
我可以更改文档结构,添加新字段,计算它们...如有必要。
感谢您的帮助 !
I need a way to filter query, in order to get documents containing array with at least one value not in a specific list.
For example :
{
id:1,
field:["dog", "cat", "bird"]
},
{
id:2,
field:["cat", "bird"]
},
{
id:3,
field:["bird"]
}
I want to filter documents which contains at least one value other than "cat" and "bird".
Expected result :
{
id:1,
field:["dog", "cat", "bird"]
}
I've found this similar question, but the answers seems to apply only with integers values :
Solr query to filter document with at least one value in array except of specified values
I can change the documents structure, add new fields, calculate them... if necessary.
Thanks for your help !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在测试期间对更复杂的值进行排序时,我犯了一个错误,因此看起来该方法不起作用。
解决方案:
非常感谢Matslindh
I've made a mistake when sorting more complex values during my tests, so it looked like the method wasn't working.
Solution :
Many thanks MatsLindh