elasticsearch - Elastic Search Nested Object mapping and Query for search -


I am trying to use elastic detection and I am trying to query for nested objects.

Originally my object is of the following format

  {"name": "some name", "field 2": [{"prop1": "val1" , "The following is the following for the mapping nested field:" val2 "}, {" prop1 ":" val3 "," prop2 "::" val4 "}}}  

{ "Properties": {"field2": {"type": "nested"}}}}

  PUT / sometval / posts / _mapping {"posts" ex> 

Now say I can insert element for / field / post / 1 and / field / post / 2 etc. I have K value for field2.prop1 and give me a query f The one that was posted on the basis of the most match of field 2. The .prop1 is between the values ​​of what would be the proper question for it, besides I tried a simple filter, but this does not seem to work right. { "Match_all": {}}}, "filter": {"nested":

  received / sometval / posts / _search {"query": {"filtered": {"query": {"Path": "field2", "filter": {"bool": {"should": [{"word": {"field2.prop1": "val1"}}]}}}, "_cache" : True}}}}  

The above query should be posted first. But it does not give a match. Can anyone help clarify the wrong things here?

There was a problem with your Jason structure, you used the filtered query, but the filter (object) query

find the difference

  post / sometval / posts / _search {"query": {"filtered": {"query": {" Match_all ": {}}," filter ": {" nested ": {" path ":" field 2 "," filter ": {" should ": {" should ": [{" word ": {" field2. Prop1 ":" val1 "}}]}}," _cache ": true}}}}}  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -