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 Otis Gospodnetic <ot...@yahoo.com> on 2003/05/01 16:28:34 UTC

RE: Range Query

I have changed RangeQuery's toString() in 1.3RC2 to use TO instead of
'-'.

Otis

--- "Hoad, Richard (AFIS)" <Ri...@fao.org> wrote:
> We toString() and reparse queries like the following with no apparent
> problems in version 1.2 but something undesirable could have crept
> into 1.3
> RC-1.
> 
> +kot:"projects" +added:[19990101-null] +changed:[20030330-null]
> 
> The reason the date looks like jibberish (lo0ddiz2jml): We use a
> org.apache.lucene.document.Field with the sortable string values you
> can see
> in the above query string.
> 
> Richard and Ennio 
> 
> -----Original Message-----
> From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com] 
> Sent: 29 April 2003 03:08
> To: Lucene Users List
> Subject: RE: Range Query
> 
> 
> 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
> 


__________________________________
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>.
Thank you very much.

Aviran

-----Original Message-----
From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com] 
Sent: Thursday, May 01, 2003 10:29 AM
To: Lucene Users List
Subject: RE: Range Query


I have changed RangeQuery's toString() in 1.3RC2 to use TO instead of
'-'.

Otis

--- "Hoad, Richard (AFIS)" <Ri...@fao.org> wrote:
> We toString() and reparse queries like the following with no apparent 
> problems in version 1.2 but something undesirable could have crept 
> into 1.3 RC-1.
> 
> +kot:"projects" +added:[19990101-null] +changed:[20030330-null]
> 
> The reason the date looks like jibberish (lo0ddiz2jml): We use a 
> org.apache.lucene.document.Field with the sortable string values you 
> can see in the above query string.
> 
> Richard and Ennio
> 
> -----Original Message-----
> From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
> Sent: 29 April 2003 03:08
> To: Lucene Users List
> Subject: RE: Range Query
> 
> 
> 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
> 


__________________________________
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