Hi Radu,
Thanks for your response.
The usecase is we have a column which is of type nested and can have any
attribute added dynamically which we dont know about.
So our mapping and sample record looks like this:
Mapping:
{
"ipdr" : {
"_source" : {
"excludes" : ["column1","column2"],
"includes" : ["mynestedcolumn.*"]
},
"properties" : {
"column1" : {"type" : "string"},
"column2" : {"type" : "string"},
"mynestedcolumn" : {
"type" : "nested"
}
}
}
}
Record:
{
"column1": "someValue",
"column2":"anotherValue",
"mynestedcolumn":
{
"serialno" : "7634786",
"count": 10,
"users":[
{
"id":"user1",
"comments":[
{
"comment":"comment1"
},
{
"comment":"comment2"
},
{
"comment":"comment3"
}
]
},
{
"id":"user2",
"comments":[
{
"comment":"dgjkdgjdg"
},
{
"comment":"Hows this?"
},
{
"comment":"No comments."
}
]
}
]
}
}
Now I want to search a document with id="user1" and comment="Hows this?"
and ideally this should not return a document.
Thanks and Regards,
Rakesh Kumar Rakshit
On Tuesday, May 14, 2013 10:22:32 PM UTC+5:30, Radu Gheorghe wrote:
Hi Rakesh,
I think you should set obj1 as type Nested:
Elasticsearch Platform — Find real-time answers at scale | Elastic
Then, you would need to use nested querieshttp://www.elasticsearch.org/guide/reference/query-dsl/nested-query/and/or
filtershttp://www.elasticsearch.org/guide/reference/query-dsl/nested-filter/to find those documents.
Best regards,
Radu
http://sematext.com/ -- Elasticsearch -- Solr -- Lucene
On Tue, May 14, 2013 at 7:15 PM, rakesh rakshit <ihavethe...@gmail.com<javascript:>
wrote:
Hi all,
I have one of the column which is nested and has structure similar to
this:
{ "obj1" : [ { "name" : "blue", "count" : 4 }, { "name" : "green", "count" : 6 } ] }
Now if I want to search an object with name= blue and count=6 , ideally this should not get a match but
this happens to find this document as a match.
So I want to get rid of this situation and want that it should not return a match for the above scenario.
How can I overcome this situation?
Can anyone suggest a solution or an alternate way to implement this?
Thanks in advance.
Regards,
Rakesh Kumar Rakshit
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.