elasticsearch - Querystring search on array elements in Elastic Search -


I am trying to learn elastic search with a simple example application, which gives a list of quotations related to people The example can be seen as a mapping: <">" people ": {" attribute ": {" name ": {" type ":" string "}," quotation ": {" type ":" string "} Some example data can look like this:

  {"name": "Mr A", "quotation": ["quote one , And this and that "," give the quote, those and that "] {" name ":" Mr. B "," quotation ": [" quotation three, y And I want to be able to use the QuickString API on individual quotations, and for those who match, for example, "Quotation four," and those "]}   

for example, I would like to find people who have a quote (in which these and these) - "Mr. A" should be returned, but not "Mr. B", and so on. How do I get it?

EDIT1:

Working with data values ​​in the answer given below for Andrey {"name" ("value": "quote two, he and he"}}}

However, Can not seem to get a query_string query for No result is generated in the following: <"> query": {"nested": {"path": "quote", "query": {"query_string": {"default_field": "quote", "query ":" Quotations.value: this and these "}}}}}

Is there any way to get a query_string query working with a nested object?

Edit 2: Yes, this is Andrei's answer.

To achieve that requirement, you Need to see nested objects, not ost For example: {"mappings": {"people": {"property": {"name": {"type": "string" {"Type": {"type": "string"}}}}}}} Value:

  {"name": "Mr. A", "quotation": [{"value": "quote one, this and that and this"}, {"value": "Quotation three, this and that"}, {"value": "quote four," "{{" value " Those and these "}]}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -