Woohoo! That's great Shay.
Sorry I haven't replied earlier. Yes, AFAIK the data is only for ipv4
though it will have to deal with ipv6 soon enough.
I was busy on my side setting up the ip address index.
You can give it a spin here :
http://174.129.14.156/geo/ip/
The document schema is :
{"hiend": "0034603007", "countrycode": "FR", "country": "FRANCE",
"lowend": "0033554432", "continent": "EUROPE", "continentcode": "EU"}
While waiting for 0.13, I've given teh following boolean search a try.
I suspect I am not expressing the comparison operators correctly.
{
"bool" : {
"must" : {
"term" : { "lowend" =< "3741319167" }
},
{
"must" : {
"term" : { "hiend" >= "3741319167" }
},
"minimum_number_should_match" : 1,
"boost" : 1.0
}
}
Any suggestions?
And once again thanks for the push. Awesome!
On Thu, Oct 28, 2010 at 11:05 AM, Shay Banon
shay.banon@elasticsearch.com wrote:
Hi,
Just pushed support ip address support (with auto
detection): Mapper: Ip Type Support (ipv4), auto detection with dynamic mapping · Issue #461 · elastic/elasticsearch · GitHub
(as discussed in a previous) thread.
Here is a simple test I do to have the previous mentioned question
(yea.., in java):
client.prepareIndex("test", "type1", "1").setSource("from",
"192.168.0.5", "to", "192.168.0.10").setRefresh(true).execute().actionGet();
SearchResponse search = client.prepareSearch()
.setQuery(boolQuery().must(rangeQuery("from").lt("192.168.0.7")).must(rangeQuery("to").gt("192.168.0.7")))
.execute().actionGet();
-shay.banon