Hello Ivy team,

Currently my team wants to use nested query in elasticsearch. Does Ivy support to search nested object in elastic search? Could show me how to configure to use nested query?

Thanks in advanced Lan Bui

asked 30.05.2017 at 07:31

bthlan's gravatar image

bthlan
11224
accept rate: 0%


Hi

We do not support nested queries over the search API currently. However you can use the following method to use elastic search query directly:

String elasticSearchQuery = "...";  // configure your elastic search query here!
ivy.repo.search(Person.class).raw(elasticSearchQuery);

Regards

Reto

link

answered 30.05.2017 at 08:10

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k182656
accept rate: 74%

hi @Reto Weiss ♦♦

do you have plan to support it?

(30.05.2017 at 22:42) trungdv trungdv's gravatar image

No, there are currently no plan to support more query features.

(31.05.2017 at 02:59) Reto Weiss ♦♦ Reto%20Weiss's gravatar image

hi @Reto Weiss ♦♦

Thanks for your answer. We will try with raw query.

I have another question. If we use nested fields, it will limit the number of documents to 50. (Please refer "Limiting the number of nested fields" section at https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html ). However 50 are quite small.

Elastic search still supports to config that number of documents by config index.mapping.nested_fields.limit (https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html#mapping-limit-settings ). Does Ivy supports to config that value?

(31.05.2017 at 03:19) bthlan bthlan's gravatar image

We use a standard installation of elasticsearch in the Designer and Engine. You find it in the elasticsearch directory inside the Designer or Engine installation directory. See file /elasticsearch/config/elasticsearch.yml to configure this.

(31.05.2017 at 03:35) Reto Weiss ♦♦ Reto%20Weiss's gravatar image

hi @Reto Weiss ♦♦

One more question, where does elastic search store index data in ivy?

(31.05.2017 at 05:59) trungdv trungdv's gravatar image

hi @Reto Weiss ♦♦

Following this post https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-query.html, object must be index as nested object in order to search with nested type (use raw query as your suggestion) So we need to run code like this example here :https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-mapping.html It will update elastics search index table.

So how can i access to instance of elastics search in ivy to execute that query? i try with Ivy.repo().search(clazz).raw(query) but i think it's not designed for this purpose.

Thanks

(31.05.2017 at 06:29) trungdv trungdv's gravatar image
showing 5 of 7 show 2 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×122

Asked: 30.05.2017 at 07:31

Seen: 1,201 times

Last updated: 31.05.2017 at 07:50