You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Aviran Mordo <am...@infosciences.com> on 2003/04/28 16:44:53 UTC
Range Query
Hi All,
I have submitted a bug report on this issue to bugzilla, but since I
haven't got any response to it I ask you guys
When the RangeQuery.toString() outputs. The result is something like
this: "PostDate:[0ddiz2jml-null]"
But the QueryParser does not handles the (-) sign (Throws and
exception), it expects the "TO" keyword. So in order for it to parse the
string.
The String has to be converted to "PostDate:[0ddiz2jml TO null]" instead
of "PostDate:[0ddiz2jml-null]"
Is this a BUG?
BTW: I use Lucene 1.3-RC1
Thanks,
Aviran Mordo
Re: Range Query
Posted by Victor Hadianto <vi...@nuix.com.au>.
> I can change the latter, but who uses toString() for anything other
> than human-friendly print-outs?
Ispecifically use the toString() method to create the string representation of
the query and store them in the database. In the future, user can browse
through the list of queries that she/he has run and re-execute them.
I found exactly the same problem with Aviran and I had to create a RangeQuery
wrapper object that translate the toString() method correctly to be parsed by
QueryParser again.
victor
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
RE: Range Query
Posted by Otis Gospodnetic <ot...@yahoo.com>.
This sounds like a web application. I'll assume this runs in a servlet
container.
You could store the (Range)Query instance in the HttpSession as well.
This is more reliable than relying on toString(), in my opinion.
Otis
--- Aviran Mordo <am...@infosciences.com> wrote:
> Well I use the toString() method to store the query in the result
> page
> in order to run the same query to get the next page.
> The reason that I use the toString method this way is because the
> query
> can be very complicated and consists of several Query objects
> (TermQuery, BooleanQuery, RangeQuery and plain ParsedQuery) combined
> together in one BooleanQuery. So this way I build the query object
> once
> according to the parameters that the user specified, and by using the
> toString() method I store the query string in the result page so when
> the user hit next page I can requery and get the next page, because
> at
> this point I don't have the original query parameters which can be a
> very long list of fields and values. Unless there is a better way of
> doing it?
>
> As for your question what is lo0ddiz2jml. This is a DateField
>
> Aviran.
>
> -----Original Message-----
> From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
> Sent: Monday, April 28, 2003 11:02 AM
> To: Lucene Users List
> Subject: Re: Range Query
>
>
> Aviran,
>
> Yes, it looks like there is a discrepency between QueryParser's Range
> Query syntax and RangeQuery.toString() method. I can change the
> latter,
> but who uses toString() for anything other than human-friendly
> print-outs?
>
> What I wonder is why that Term, lo0ddiz2jml, oks like gibberish?
>
> Otis
>
> --- Aviran Mordo <am...@infosciences.com> wrote:
> > Hi All,
> > I have submitted a bug report on this issue to bugzilla, but since
> I
> > haven't got any response to it I ask you guys
> >
> > When the RangeQuery.toString() outputs. The result is something
> like
> > this: "PostDate:[0ddiz2jml-null]"
> >
> > But the QueryParser does not handles the (-) sign (Throws and
> > exception), it expects the "TO" keyword. So in order for it to
> parse
> > the string.
> >
> > The String has to be converted to "PostDate:[0ddiz2jml TO null]"
> > instead of "PostDate:[0ddiz2jml-null]"
> >
> > Is this a BUG?
> >
> > BTW: I use Lucene 1.3-RC1
> >
> >
> >
> > Thanks,
> >
> > Aviran Mordo
> >
> >
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
RE: Range Query
Posted by Aviran Mordo <am...@infosciences.com>.
Well I use the toString() method to store the query in the result page
in order to run the same query to get the next page.
The reason that I use the toString method this way is because the query
can be very complicated and consists of several Query objects
(TermQuery, BooleanQuery, RangeQuery and plain ParsedQuery) combined
together in one BooleanQuery. So this way I build the query object once
according to the parameters that the user specified, and by using the
toString() method I store the query string in the result page so when
the user hit next page I can requery and get the next page, because at
this point I don't have the original query parameters which can be a
very long list of fields and values. Unless there is a better way of
doing it?
As for your question what is lo0ddiz2jml. This is a DateField
Aviran.
-----Original Message-----
From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
Sent: Monday, April 28, 2003 11:02 AM
To: Lucene Users List
Subject: Re: Range Query
Aviran,
Yes, it looks like there is a discrepency between QueryParser's Range
Query syntax and RangeQuery.toString() method. I can change the latter,
but who uses toString() for anything other than human-friendly
print-outs?
What I wonder is why that Term, lo0ddiz2jml, oks like gibberish?
Otis
--- Aviran Mordo <am...@infosciences.com> wrote:
> Hi All,
> I have submitted a bug report on this issue to bugzilla, but since I
> haven't got any response to it I ask you guys
>
> When the RangeQuery.toString() outputs. The result is something like
> this: "PostDate:[0ddiz2jml-null]"
>
> But the QueryParser does not handles the (-) sign (Throws and
> exception), it expects the "TO" keyword. So in order for it to parse
> the string.
>
> The String has to be converted to "PostDate:[0ddiz2jml TO null]"
> instead of "PostDate:[0ddiz2jml-null]"
>
> Is this a BUG?
>
> BTW: I use Lucene 1.3-RC1
>
>
>
> Thanks,
>
> Aviran Mordo
>
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
Re: Range Query
Posted by Otis Gospodnetic <ot...@yahoo.com>.
Aviran,
Yes, it looks like there is a discrepency between QueryParser's Range
Query syntax and RangeQuery.toString() method.
I can change the latter, but who uses toString() for anything other
than human-friendly print-outs?
What I wonder is why that Term, lo0ddiz2jml, oks like gibberish?
Otis
--- Aviran Mordo <am...@infosciences.com> wrote:
> Hi All,
> I have submitted a bug report on this issue to bugzilla, but since I
> haven't got any response to it I ask you guys
>
> When the RangeQuery.toString() outputs. The result is something like
> this: "PostDate:[0ddiz2jml-null]"
>
> But the QueryParser does not handles the (-) sign (Throws and
> exception), it expects the "TO" keyword. So in order for it to parse
> the
> string.
>
> The String has to be converted to "PostDate:[0ddiz2jml TO null]"
> instead
> of "PostDate:[0ddiz2jml-null]"
>
> Is this a BUG?
>
> BTW: I use Lucene 1.3-RC1
>
>
>
> Thanks,
>
> Aviran Mordo
>
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org