lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adriano Crestani <adrianocrest...@gmail.com>
Subject Re: Small issue in queryparser // ParametricRangeQueryNode.java
Date Sun, 08 May 2011 20:24:48 GMT
Hi Karsten,

No, AFAIK, no one is working on such feature, feel free to work on it, I am
sure there are many people waiting for such feature :)

Now, about the contradiction you mentioned below, I can't see it in the
code:

because
 (upperBound == lowerBound
 &&
 !upperBound.getField().equals(lowerBound.getField()))
 is a contradiction)

Can you explain more on this problem you see in the code?

Also, what you think that should be the constraint condition does not make
sense for me. The contraints asserts whether the upper and lower bounds have
the same field name, correct?! The condition you proposed below would not
throw an exception if upper.getField() is NULL and lower is something else,
which is wrong, an exception should be thrown, since the field names are
different.

most possible it should be

   if(upperBound.getField() == null
      ||
      (upperBound.getField() != lowerBound.getField()
       && !upperBound.getField().equals(
           lowerBound.getField()))) {
     throw new IllegalArgumentException(
     ...


Am I missing something?

Best Regards,
Adriano Crestani


On Sun, May 8, 2011 at 1:00 PM, Karsten Fissmer <karsten-solr@gmx.de> wrote:

> Hi Michael Busch,
>
> The Class ParametricRangeQueryNode was inserted in svn with LUCENE-1567
> "New flexible query parser".
>
> The constructor
>  public ParametricRangeQueryNode(ParametricQueryNode lowerBound,
>      ParametricQueryNode upperBound) {
> has a constraint about his parameters:
>
>    if (upperBound.getField() != lowerBound.getField()
>        || (upperBound.getField() != null && !upperBound.getField().equals(
>            lowerBound.getField()))) {
>      throw new IllegalArgumentException(
>      ...
>
> most possible it should be
>
>    if(upperBound.getField() == null
>       ||
>       (upperBound.getField() != lowerBound.getField()
>        && !upperBound.getField().equals(
>            lowerBound.getField()))) {
>      throw new IllegalArgumentException(
>      ...
> (
>  because
>  (upperBound == lowerBound
>  &&
>  !upperBound.getField().equals(lowerBound.getField()))
>  is a contradiction)
> )
>
> Best regards
>
>  Karsten
>  http://www.xing.com/profile/Karsten_Fissmer
>
>
> P.S. currently I am working with SpanQueries in the queryparser-module, so
> I wrote e.g. SpanNearQueryNode. Is this work already down by someone else?
>

Mime
View raw message