可以使用lucene查询语法搜索ElasticSearch中的嵌套对象吗? [英] Is it possible to search nested objects in ElasticSearch with the lucene query syntax?

查看:137
本文介绍了可以使用lucene查询语法搜索ElasticSearch中的嵌套对象吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很喜欢使用ElasticSearch的Lucene查询语言的简单组合。我们刚刚开始使用嵌套对象,我明白我需要使用嵌套查询来搜索它们,但是在使用Lucene语法进行嵌套查询时,我无法找到任何信息。



如果可能的话,是否有某些文件在某个地方?



我已经做了相当广泛的搜索elasticsearch lucene,我很难找到偶尔博客提到语法,更不用说实际文档了。同样,在Stack Overflow上搜索也是非常无效的。

解决方案

目前,Lucene不支持此功能。 b
$ b

Elastic Github回购中有一些相关问题,但主要的可在#11322支持查询字符串查询DSL中的嵌套查询语法



相关的pull请求:#11339 feature / querystringquery-nestedqueries



如果您检查讨论,你会看到,这不是ES的人认为现在值得潜水的东西。



所以唯一的方法来查询嵌套的类型对象是使用嵌套的查询/过滤器。


I really like the simple composability of the Lucene query language with ElasticSearch. We've just started using nested objects, and I understand that I need to use a nested query to search them, but I can't find any information anywhere on making a nested query using the Lucene syntax.

If it is possible, is there some documentation somewhere?

I've done fairly extensive googling for "elasticsearch lucene" and I'm hard pressed to find the occasional blog post mentioning the syntax, let alone actual documentation. Likewise, searching here on Stack Overflow has been pretty fruitless.

解决方案

This is currently not supported by Lucene.

There are a few related issues in the Elastic Github repo, but the main one is available at #11322 Support for nested query syntax within query string query DSL

And the related pull request: #11339 feature/querystringquery-nestedqueries

If you check the discussions, you'll see that this is not something that the ES folks think is worth diving into right now.

So the only way to query nested type objects is by using the nested queries/filters.

这篇关于可以使用lucene查询语法搜索ElasticSearch中的嵌套对象吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆