【发布时间】:2014-02-16 03:00:30
【问题描述】:
假设我有一个如下所示的记录:
{
"title": "Random title",
"authors": [
{
"first": "Jordan",
"last": "Reiter"
… more fields here …
},
{
"first": "Joe",
"last": "Schmoe"
… more fields here …
},
]
}
我希望用户能够按作者搜索记录,如果他们输入完整的查询 Jordan Reiter,它会提取该记录(以及至少有一位作者与这些字段匹配的其他记录。
我不希望用户必须指定第一个/最后一个字段,我不一定知道他们是否在搜索 Jordan Reiter Reiter Jordan 甚至 J Reiter 所以理想情况下我想匹配所有这些案例中的一个,同时仍然对其进行过滤,例如,这些记录都不匹配:
{
"title": "About Jordan Reiter",
"authors": [
{
"first": "Susan",
"last": "Schmusan"
… more fields here …
}
]
}
{
"title": "Completely different authors",
"authors": [
{
"first": "Robert",
"last": "Jordan"
… more fields here …
},
{
"first": "Samuel",
"last": "Reiter"
… more fields here …
},
]
}
刚开始使用 ElasticSearch,所以如果我缺少基本概念,请告诉我。
我打算让 authors 字段成为嵌套类型。
【问题讨论】:
标签: elasticsearch