【发布时间】:2015-06-01 15:00:26
【问题描述】:
我有一份表格文件
'search':
[
{
id:'1',
"content": [
{
"text": "random text .....",
"time": 150.023
},
{
"text": "random text .....",
"time": 160.023
}
]
},
{
id:'2',
"content": [
{
"text": "random text .....",
"time": 150.023
},
{
"text": "random text .....",
"time": 160.023
}
]
}
.
.
.
]
我想搜索文本字段并获取其 id、文本和时间,例如
我的示例文档和索引搜索如下所示
'search':
[
{
id:'1',
"content": [
{
"text": "Algorithm and Data structure",
"time": 150.023
},
{
"text": "Selection Sort",
"time": 160.023
}
]
},
{
id:'2',
"content": [
{
"text": "Database and schema",
"time": 1530.023
}
]
}
.
.
.
]
现在当我搜索“text:Algorithm”时,我需要 id:'1'、“text”:“算法和数据结构”和“时间”:150.023。
如何使用 elasticsearch 获得上述结果。请提供一些解决方案。提前谢谢你。
【问题讨论】:
标签: python search indexing elasticsearch