我正在尝试通过字段包含/包含动态文本从ElasticSearch中获取文档。示例:那些文件是用橡皮筋做的
{
id: 12345,
name: test66,
description: 'some desc231431',
entity_id 9201a22asdasdadbfbfe3642994,
entity: entity1,
tag_ids: [],
owners: [],
account_id: asd1233124124,
integration_type: integartionType1
}
{
id: 12345,
name: name2,
description: 'some desc',
entity_id 9201a22asdasdadbfbfe3642994,
entity: entity1,
tag_ids: ['123445','sadx'],
owners: [],
account_id: asd1233124124,
integration_type: integartionType1
}
{
id: 12345,
name: name3,
description: 'this is test !!!!',
entity_id 9201a22asdasdadbfbfe3642994,
entity: entity1,
tag_ids: ['test','1'],
owners: [],
account_id: asd1233124124,
integration_type: integartionType1
}
我想获取文档,其中字段name,description,tag_ids包含来自此文本HEY_TEST_TABLE
的部分匹配。
谢谢!
1条答案
按热度按时间lfapxunr1#
在
should
子句中使用带有三个匹配查询的bool query
来搜索字段name
、description
或tag_ids
包含文本中部分匹配项的文档。或者你可以使用the multi-match查询。