I've just noticed that the range facet includes the 'from' value and
excludes the 'to' value from its results.
It's fine but is not consistent with RangeQuery which by default
includes both the 'from' and 'to' values.
Do you guys feel that both range facet and range query should support
the same default behavior?
Should I log a bug for this?
Yea, it is different... . One of the reasoning for that is that you don't have the option to set if lower and upper should be included or not, compared to range filter, where you have that option.
On Wednesday, June 29, 2011 at 2:30 AM, stephane wrote:
Hi,
I've just noticed that the range facet includes the 'from' value and
excludes the 'to' value from its results.
It's fine but is not consistent with RangeQuery which by default
includes both the 'from' and 'to' values.
Do you guys feel that both range facet and range query should support
the same default behavior?
Should I log a bug for this?
On Wed, 2011-06-29 at 15:05 +0300, Shay Banon wrote:
Yea, it is different... . One of the reasoning for that is that you
don't have the option to set if lower and upper should be included or
not, compared to range filter, where you have that option.
But don't forget that you can use 'gt','gte','lt','lte' instead of
from/to
You can't use it in the range facet though :), it only supports from/to. It was just me being lazy, we need to add support for similar functionality that we have in range filter to the facet.
On Wednesday, June 29, 2011 at 3:10 PM, Clinton Gormley wrote:
On Wed, 2011-06-29 at 15:05 +0300, Shay Banon wrote:
Yea, it is different... . One of the reasoning for that is that you
don't have the option to set if lower and upper should be included or
not, compared to range filter, where you have that option.
But don't forget that you can use 'gt','gte','lt','lte' instead of
from/to
Lemme try and explain the reasoning though behind just doing from/to and the fact that to is not included. Basically, it lends itself more towards creating range facet over consecutive ares (like 0-100, 100-1000, 1000-50000), where you don't want to compute the doc twice across boundaries.
On Wednesday, June 29, 2011 at 3:14 PM, Shay Banon wrote:
You can't use it in the range facet though :), it only supports from/to. It was just me being lazy, we need to add support for similar functionality that we have in range filter to the facet.
On Wednesday, June 29, 2011 at 3:10 PM, Clinton Gormley wrote:
On Wed, 2011-06-29 at 15:05 +0300, Shay Banon wrote:
Yea, it is different... . One of the reasoning for that is that you
don't have the option to set if lower and upper should be included or
not, compared to range filter, where you have that option.
But don't forget that you can use 'gt','gte','lt','lte' instead of
from/to
On Wed, 2011-06-29 at 15:16 +0300, Shay Banon wrote:
Lemme try and explain the reasoning though behind just doing from/to
and the fact that to is not included. Basically, it lends itself more
towards creating range facet over consecutive ares (like 0-100,
100-1000, 1000-50000), where you don't want to compute the doc twice
across boundaries.
To me, this is not intuitive, especially when the behaviour of the same
keyword is different in similar constructs.
If I say I'm going to Madrid, I don't mean that I'm going to just
outside Madrid. Similarly, just reading the query, and without being
aware of the unexpected meaning of 'to', I wouldn't know which range an
edge value would fall into.
I think it'd be clearer to support the gt,gte etc - that way it is clear
which values the range should include or exclude.
As Clinton pointed-out, the think that is not intuitive is the fact that
the same keyword behaves differently in similar constructs. That's
fairly confusing and unexpected. As a matter of fact, I probably spent
1 hour trying to figure out why the RangeFacet didn't include some
results. Then I realized that the meaning of the 'to' field was
different.
Another thing which is rather confusing is when you use the 'from' and
'to' values of a RangeFacet and create a RangeFilter from them. The
confusing part is that the RangeFacet indicates that you'll get say '20'
results but the RangeFilter returns more than '20' results (since it
includes the 'to' value).
I suggest that we add 'gt','gte','lt','lte' to the RangeFacet to mimic
the options supported by the RangeFilter. I also suggest that the 'to'
value should be included by default.
If you guys agree, I can file a bug and create a patch for it.
Stephane Bastian
On Wed, 2011-06-29 at 14:27 +0200, Clinton Gormley wrote:
On Wed, 2011-06-29 at 15:16 +0300, Shay Banon wrote:
Lemme try and explain the reasoning though behind just doing from/to
and the fact that to is not included. Basically, it lends itself more
towards creating range facet over consecutive ares (like 0-100,
100-1000, 1000-50000), where you don't want to compute the doc twice
across boundaries.
To me, this is not intuitive, especially when the behaviour of the same
keyword is different in similar constructs.
If I say I'm going to Madrid, I don't mean that I'm going to just
outside Madrid. Similarly, just reading the query, and without being
aware of the unexpected meaning of 'to', I wouldn't know which range an
edge value would fall into.
I think it'd be clearer to support the gt,gte etc - that way it is clear
which values the range should include or exclude.
I agree that we can add more options to define the range aspect, but disagree on the "from" and "to" default behavior for the reason I explained below. Many users do range facets on {from : 0, to: 10}, {from: 10, to: 20), and having to included will simply be wrong (or a wrong default).
On Wednesday, June 29, 2011 at 6:47 PM, stephane wrote:
Hi All,
As Clinton pointed-out, the think that is not intuitive is the fact that
the same keyword behaves differently in similar constructs. That's
fairly confusing and unexpected. As a matter of fact, I probably spent
1 hour trying to figure out why the RangeFacet didn't include some
results. Then I realized that the meaning of the 'to' field was
different.
Another thing which is rather confusing is when you use the 'from' and
'to' values of a RangeFacet and create a RangeFilter from them. The
confusing part is that the RangeFacet indicates that you'll get say '20'
results but the RangeFilter returns more than '20' results (since it
includes the 'to' value).
I suggest that we add 'gt','gte','lt','lte' to the RangeFacet to mimic
the options supported by the RangeFilter. I also suggest that the 'to'
value should be included by default.
If you guys agree, I can file a bug and create a patch for it.
Stephane Bastian
On Wed, 2011-06-29 at 14:27 +0200, Clinton Gormley wrote:
On Wed, 2011-06-29 at 15:16 +0300, Shay Banon wrote:
Lemme try and explain the reasoning though behind just doing from/to
and the fact that to is not included. Basically, it lends itself more
towards creating range facet over consecutive ares (like 0-100,
100-1000, 1000-50000), where you don't want to compute the doc twice
across boundaries.
To me, this is not intuitive, especially when the behaviour of the same
keyword is different in similar constructs.
If I say I'm going to Madrid, I don't mean that I'm going to just
outside Madrid. Similarly, just reading the query, and without being
aware of the unexpected meaning of 'to', I wouldn't know which range an
edge value would fall into.
I think it'd be clearer to support the gt,gte etc - that way it is clear
which values the range should include or exclude.
I'm lagging behind on this one.
so let me open a feature request to add more options (include
lower/upper, gte, gt, lte...).
I'll also take a stab at implementing the changes and send a pull
request if everything is working fine. Right now I'm fighting with
Eclipse to get it correctly configured with ES source and gradle
dependencies...
Stephane
On Wed, 2011-06-29 at 21:33 +0300, Shay Banon wrote:
I agree that we can add more options to define the range aspect, but
disagree on the "from" and "to" default behavior for the reason I
explained below. Many users do range facets on {from : 0, to: 10},
{from: 10, to: 20), and having to included will simply be wrong (or a
wrong default).
On Wednesday, June 29, 2011 at 6:47 PM, stephane wrote:
Hi All,
As Clinton pointed-out, the think that is not intuitive is the fact
that
the same keyword behaves differently in similar constructs. That's
fairly confusing and unexpected. As a matter of fact, I probably
spent
1 hour trying to figure out why the RangeFacet didn't include some
results. Then I realized that the meaning of the 'to' field was
different.
Another thing which is rather confusing is when you use the 'from'
and
'to' values of a RangeFacet and create a RangeFilter from them. The
confusing part is that the RangeFacet indicates that you'll get say
'20'
results but the RangeFilter returns more than '20' results (since it
includes the 'to' value).
I suggest that we add 'gt','gte','lt','lte' to the RangeFacet to
mimic
the options supported by the RangeFilter. I also suggest that the
'to'
value should be included by default.
If you guys agree, I can file a bug and create a patch for it.
Stephane Bastian
On Wed, 2011-06-29 at 14:27 +0200, Clinton Gormley wrote:
On Wed, 2011-06-29 at 15:16 +0300, Shay Banon wrote:
Lemme try and explain the reasoning though behind just doing
from/to
and the fact that to is not included. Basically, it lends itself
more
towards creating range facet over consecutive ares (like 0-100,
100-1000, 1000-50000), where you don't want to compute the doc
twice
across boundaries.
To me, this is not intuitive, especially when the behaviour of the
same
keyword is different in similar constructs.
If I say I'm going to Madrid, I don't mean that I'm going to just
outside Madrid. Similarly, just reading the query, and without
being
aware of the unexpected meaning of 'to', I wouldn't know which
range an
edge value would fall into.
I think it'd be clearer to support the gt,gte etc - that way it is
clear
which values the range should include or exclude.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.