Dear All,
I am using elastic for venue search in that i do have title, latitude and
longitude.
I have some what 4 lac data.
My concern is that i wanted to search the text which will produce the
relevant result with nearest distance.
Right now i am using "geo_distance"
you can see my below code so that you can come to know what i am using,
curl -X PUT 'http://localhost:9200/adminvenue/?pretty=true' -d '
{
"settings" : {
"analysis" : {
"analyzer" : {
"venue_analyzer" : {
"tokenizer" : "standard",
"filter" : ["standard", "lowercase", "venue_metaphone",
"asciifolding"]
}
},
"filter" : {
"venue_metaphone" : {
"type" : "phonetic",
"encoder" : "metaphone",
"replace" : false
}
}
}
}
}
curl -X PUT
'http://localhost:9200/adminvenue/jos_content/_mapping?pretty=true' -d '
{
"jos_content" : {
"properties" : {
"title" : {
"type": "string",
"index_analyzer": "venue_analyzer",
"search_analyzer": "venue_analyzer"
},
"location" : {
"type" : "geo_point",
"lat_lon": true
}
}
}
}
$result = $es->search(array(
"query" => array(
"dis_max" => array(
"queries" => array(
0 => array(
"field" => array(
"title" => "palexpo"
)
)
)
)
),
"from" => 0,
"size" => 100000,
"filter" => array(
"geo_distance" => array(
"distance" => "10000mi",
"jos_content.location" => array(
"lat" => "37.77519600",
"lon" => "-122.41920400"
)
)
),
"sort" => array(
//0 => "_score",
0 => array(
"_geo_distance" => array(
"jos_content.location" => array(
"lat" => "37.77519600",
"lon" => "-122.41920400"
),
"order" => "asc",
"unit" => "km"
)
)
)
)
);
Sorry for big code,
Above code gives me nearest distance venue but not palexpo which i actually
search, palexpo comes after 20 25 results.
Please help if you have any suggestion,
Thanks,
Vallabh
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/62b2b233-1818-4e4e-9aee-d42b0683d7c8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.