solr - Solr 6 - 使用子查询/连接查询多个子文档
问题描述
我正在尝试使用来自子文档查询之一的字段值作为第二/第三个子文档查询的输入,对子文档运行父查询。
下面是一个索引示例:
[
{
"id":1,
"title":"good",
"content_type":"parent",
"_childDocuments_":[
{
"id":"1_1",
"type":"color",
"value":"orange",
"start":"2015-01-03T14:32:00Z",
"end":"2015-01-03T14:34:00Z"
},
{
"id":"1_2",
"type":"shape",
"value":"square",
"start":"2015-01-03T14:32:00Z",
"end":"2015-01-03T14:34:00Z"
}
]
},
{
"id":2,
"title":"bad",
"content_type":"parent",
"_childDocuments_":[
{
"id":"2_1",
"type":"color",
"value":"orange",
"start":"2015-01-03T14:32:00Z",
"end":"2015-01-03T14:34:00Z"
},
{
"id":"2_2",
"type":"shape",
"value":"square",
"start":"2015-01-03T14:35:00Z",
"end":"2015-01-03T14:37:00Z"
}
]
}
]
我要做的是查询在时间范围内重叠的“color:orange”和“shape:square”的实例,并返回发生这种情况的父文档。在上面的例子中,我只希望文档 1 返回。
我尝试了很多查询,这是我认为可能最接近的查询,但仍返回 0 个结果:
{!parent which="content_type:parent"}type:color AND value:orange AND start:{!join from=start to=start}type:shape AND value:square
我知道日期位没有解决,就重叠范围而言,我只是想在遇到日期问题之前证明这个概念。
提前致谢。
解决方案
推荐阅读
- uwp - 白标 UWP 应用程序
- java - 在JAVA中遍历多个JSON数组
- object - 从 salesforce 对象中检索超过 2000 条记录的过程。
- javascript - 如何查找与 Microsoft SharePoint 文档关联的 OneDrive 项目 ID
- java - 为什么在运行状态下将一些文件移入tomcat后不为请求服务?
- python - 使用列表中的匹配字符串更改列名
- flutter - Flutter 小部件测试 - 未连接键盘
- python - 将大量大型列表写入文件
- python - 是否可以让一些轴标签覆盖 matplotlib 图中的多个列?
- c - cs50 pset 4 filter blur [only one test passes]