fmarchand
(fmarchand)
October 17, 2012, 2:40pm
1
I have indexed document in my elastic search. Here is the mapping :
{
"offers": {
"offer": {
"properties": {
"company": {
"dynamic": "true",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"description": {
"type": "string"
},
"location": {
"type": "nested",*
"properties": {*
"id": {*
"type": "string"*
},*
"name": {*
"type": "string"*
},*
"pin": {*
"type": "geo_point"*
}*
}*
}*,
"publicationDate": {
"type": "long",
"ignore_malformed": false
},
"title": {
"type": "string"
}
}
}
}
}
My problem is with the location/pin field. I would like to run a query like
this :
{
"query": {
"match_all" : { }
},
"filter" : {
"geo_distance" : {
"distance" : "5000km",
"location.pin" : {"lat":45.75,"lon":4.85}
}
}
}
I have no hits ... I'm missing something or I don't use nested type
correctly ... or ... I don't know
Can I have some help about this ?
--
I have no hits ... I'm missing something or I don't use nested type
correctly ... or ... I don't know
Nested objects need to be queried with nested query or nested filter
clint
Can I have some help about this ?
--
--
fmarchand
(fmarchand)
October 17, 2012, 2:51pm
3
ok ... removing *"type": "nested" *solved the pb. I was not using nested
for the right thing ....
thx
On Wednesday, October 17, 2012 4:40:52 PM UTC+2, fmarchand wrote:
I have indexed document in my Elasticsearch. Here is the mapping :
{
"offers": {
"offer": {
"properties": {
"company": {
"dynamic": "true",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"description": {
"type": "string"
},
"location": {
"type": "nested",*
"properties": {*
"id": {*
"type": "string"*
},*
"name": {*
"type": "string"*
},*
"pin": {*
"type": "geo_point"*
}*
}*
}*,
"publicationDate": {
"type": "long",
"ignore_malformed": false
},
"title": {
"type": "string"
}
}
}
}
}
My problem is with the location/pin field. I would like to run a query
like this :
{
"query": {
"match_all" : { }
},
"filter" : {
"geo_distance" : {
"distance" : "5000km",
"location.pin" : {"lat":45.75,"lon":4.85}
}
}
}
I have no hits ... I'm missing something or I don't use nested type
correctly ... or ... I don't know
Can I have some help about this ?
--
fmarchand
(fmarchand)
October 17, 2012, 2:54pm
4
Yes, you're right
Is nested query used for objects in an array ? like a query on a list of
objects ?
I will try to read more about it ...
Thx !
On Wednesday, October 17, 2012 4:46:30 PM UTC+2, Clinton Gormley wrote:
I have no hits ... I'm missing something or I don't use nested type
correctly ... or ... I don't know
Nested objects need to be queried with nested query or nested filter
clint
Can I have some help about this ?
--
--