2017-08-05 87 views
0

我曾经有型与现场的Guid地铁站乐团,和我正在寻找在弹性:ElasticSearch在名单<Guid>搜索使用鸟巢C#

.Query(q => q.Term(tr => tr.Field(fl => fl.MetroStation).Value(MyMetroStation)) 

现在改变GuidList<Guid>。我如何在弹性搜索这个?

+0

我想通过列表在价值 –

回答

0

,如果你想找到Person文件,其中MetroStation的GUID 包含查询的GUID你不需要改变你的搜索以任何方式。

如果你正在寻找Person文件,其中MetroStation的GUID包含究竟是什么在查询中,那么你可能会consider also indexing the number of Guids in the collection to also query on。您可以通过使用脚本查询来实现此目的,但如果您正在寻找性能,那么索引计数可能会表现更好(根据您的用例进行衡量)。

+0

到SERCH我想通过列表金额 –

+0

我需要somethink像这样SERCH,但在鸟巢: '$ PARAMS [“指数”] =“宠物小精灵”; $ params ['type'] ='pokemon_trainer'; $ params ['body'] ['query'] ['bool'] ['must'] ['terms'] ['age'] = array(10,15);' –

+1

查看条件查询:https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/terms-query-usage.html –