Range Filter strange behavior for numeric datat ype like integer, long, double

I have a field with integer data type, i tried with long and double also.
This field has values from 0 - 200.

I am using a simple filter which i had tried with from-to, gt-lt, gte-lte.
The filter gives proper result but the strange behavior comes when i select
0-100.
When I select 0-99 it gives proper result suppose lets assume it return 15
result.
So when I select 0-100 it must show at least 15 or more but it wont it
returns less than 15 result this is very strange behavior.
Same for 0- more than 100 it means anything which is more than 100 it
doesn't return proper result.

Please help, why this is happening? Is there any bug?
(Note: I am talking about Range Filter, Not Range Query. Please Help.)

--
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.

Hello,

This is rather strange - I certainly didn't experience it.

Can you please provide a curl
recreationhttp://www.elasticsearch.org/help/of the issue? That
should help identify whether it's a problem with your
approach or the software. Or maybe both :slight_smile:

Best regards,
Radu

http://sematext.com/ -- Elasticsearch -- Solr -- Lucene

On Sat, Apr 6, 2013 at 8:30 AM, Vivek Muthal vmuthal.18@gmail.com wrote:

I have a field with integer data type, i tried with long and double also.
This field has values from 0 - 200.

I am using a simple filter which i had tried with from-to, gt-lt, gte-lte.
The filter gives proper result but the strange behavior comes when i
select 0-100.
When I select 0-99 it gives proper result suppose lets assume it return 15
result.
So when I select 0-100 it must show at least 15 or more but it wont it
returns less than 15 result this is very strange behavior.
Same for 0- more than 100 it means anything which is more than 100 it
doesn't return proper result.

Please help, why this is happening? Is there any bug?
(Note: I am talking about Range Filter, Not Range Query. Please Help.)

--
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.

Hello,
The field is map to integer only.

This is the json which is in $q :
{
"from": 0,
"size": "20",
"filter": {
"bool": {
"must": {
"range": {
"resume.experience": {
"gte": 0,
"lte": 101
}
}
}
}
}
}

//curl -X post
function query($type, $q){
return $this->call($type . '/_search?q?', array('method' =>
'POST','content' => $q));
}
function function call($path, $http = array()){
{
return json_decode(file_get_contents($this->server . '/' . $this->index .
'/' . $path, NULL, stream_context_create(array('http' => $http))));
}

I tried with different tools also facing same issue not filtering properly
after 100.

On Saturday, April 6, 2013 8:45:02 PM UTC+5:30, Radu Gheorghe wrote:

Hello,

This is rather strange - I certainly didn't experience it.

Can you please provide a curl recreationhttp://www.elasticsearch.org/help/of the issue? That should help identify whether it's a problem with your
approach or the software. Or maybe both :slight_smile:

Best regards,
Radu

http://sematext.com/ -- Elasticsearch -- Solr -- Lucene

On Sat, Apr 6, 2013 at 8:30 AM, Vivek Muthal <vmuth...@gmail.com<javascript:>

wrote:

I have a field with integer data type, i tried with long and double also.
This field has values from 0 - 200.

I am using a simple filter which i had tried with from-to, gt-lt, gte-lte.
The filter gives proper result but the strange behavior comes when i
select 0-100.
When I select 0-99 it gives proper result suppose lets assume it return
15 result.
So when I select 0-100 it must show at least 15 or more but it wont it
returns less than 15 result this is very strange behavior.
Same for 0- more than 100 it means anything which is more than 100 it
doesn't return proper result.

Please help, why this is happening? Is there any bug?
(Note: I am talking about Range Filter, Not Range Query. Please Help.)

--
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.

Hello,
The field is map to integer only.

This is the json which is in $q :
{
"from": 0,
"size": "20",
"filter": {
"bool": {
"must": {
"range": {
"experience": {
"gte": 0,
"lte": 101
}
}
}
}
}
}

//curl -X post
function query($type, $q){
return $this->call($type . '/_search?q?', array('method' =>
'POST','content' => $q));
}
function function call($path, $http = array()){
{
return json_decode(file_get_contents(
$this->server . '/' . $this->index . '/' . $path, NULL,
stream_context_create(array('http' => $http))));
}

I tried with different tools also facing same issue not filtering properly
after 100.

On Saturday, April 6, 2013 8:45:02 PM UTC+5:30, Radu Gheorghe wrote:

Hello,

This is rather strange - I certainly didn't experience it.

Can you please provide a curl recreationhttp://www.elasticsearch.org/help/of the issue? That should help identify whether it's a problem with your
approach or the software. Or maybe both :slight_smile:

Best regards,
Radu

http://sematext.com/ -- Elasticsearch -- Solr -- Lucene

On Sat, Apr 6, 2013 at 8:30 AM, Vivek Muthal <vmuth...@gmail.com<javascript:>

wrote:

I have a field with integer data type, i tried with long and double also.
This field has values from 0 - 200.

I am using a simple filter which i had tried with from-to, gt-lt, gte-lte.
The filter gives proper result but the strange behavior comes when i
select 0-100.
When I select 0-99 it gives proper result suppose lets assume it return
15 result.
So when I select 0-100 it must show at least 15 or more but it wont it
returns less than 15 result this is very strange behavior.
Same for 0- more than 100 it means anything which is more than 100 it
doesn't return proper result.

Please help, why this is happening? Is there any bug?
(Note: I am talking about Range Filter, Not Range Query. Please Help.)

--
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.

On Tue, 2013-04-09 at 03:39 -0700, Vivek Muthal wrote:

Hello,
The field is map to integer only.

Are you sure?

If the field is actually type 'string', then it will sort terms
alphabetically, not numerically.

This is why Radu asked for a complete recreation, not just the query

clint

--
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.

@Radu and @Clinton thanks for support :slight_smile:

You are right, I used a tool to see actual data types, it mapped all
field's to string except date.
I am using a library where i set the properties, Dont know it's problem of
library or anything else that it maps all fields to string. But at least it
helped me to figure out the problem, the problem is data type. I have to
find a way to map fields properly.

"If the field is actually type 'string', then it will sort terms
alphabetically, not numerically. " This sentence helped me a lot. Thanks
for support :slight_smile:

On Tuesday, April 9, 2013 5:39:25 PM UTC+5:30, Clinton Gormley wrote:

On Tue, 2013-04-09 at 03:39 -0700, Vivek Muthal wrote:

Hello,
The field is map to integer only.

Are you sure?

If the field is actually type 'string', then it will sort terms
alphabetically, not numerically.

This is why Radu asked for a complete recreation, not just the query

clint

--
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.