Mailing List Archive

Query Rewriting
I want to perform some rewriting rules on the queries I get. The best way to
do that is to edit the parse tree.

However, the Query classes do not contain any methods for reading out or
altering their contents or to clone them.

Is there any reason for that? Or is this just a feature nobody has needed
yet?

I'd rather do that than altering the query string.

I just ask because I fear I will end up rewriting all the Query classes to
suit my needs, which will be become a tedious integration task as Lucene
evolves. If there's an interest I could contribute the code then.

Regards,

Clemens



--------------------------------------
http://www.cmarschner.net



--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: Query Rewriting [ In reply to ]
Clemens Marschner wrote:
> I want to perform some rewriting rules on the queries I get. The best way to
> do that is to edit the parse tree.
>
> However, the Query classes do not contain any methods for reading out or
> altering their contents or to clone them.
>
> Is there any reason for that? Or is this just a feature nobody has needed
> yet?

The latter. My style is not to add features that are not used. But
several folks have asked for this, so probably it is time to add it.

> I just ask because I fear I will end up rewriting all the Query classes to
> suit my needs, which will be become a tedious integration task as Lucene
> evolves. If there's an interest I could contribute the code then.

Please submit diffs. It should just be a matter of adding a few simple
accessors to each query class, e.g., to return BooleanQuery's set of
boolean clauses, to return TermQuery's term, to return PhraseQuery's
terms, etc.

Doug


--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: Query Rewriting [ In reply to ]
> Please submit diffs.

Yeah, I'll do that on the weekend, have to get the latest from CVS (no fast
Internet connection today).
My IDE converts tabs to spaces when saving. Severe?

>@@ -151,7 +151,7 @@
> Term term = enum.term();
> if (term != null && term.field() == testField)
> {
>- if (!checkLower ||
term.text().compareTo(lowerText) > 0)
>+ if (!checkLower ||
term.text().compareTo(lowerText) > 0)
> {
> checkLower = false;
> if (upperTerm != null)

--C.


--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: Query Rewriting [ In reply to ]
Good IDE :) Spaces are healthier.
We should standardize and require that, actually.

Otis

--- Clemens Marschner <cmad@lanlab.de> wrote:
> > Please submit diffs.
>
> Yeah, I'll do that on the weekend, have to get the latest from CVS
> (no fast
> Internet connection today).
> My IDE converts tabs to spaces when saving. Severe?
>
> >@@ -151,7 +151,7 @@
> > Term term = enum.term();
> > if (term != null && term.field() == testField)
> > {
> >- if (!checkLower ||
> term.text().compareTo(lowerText) > 0)
> >+ if (!checkLower ||
> term.text().compareTo(lowerText) > 0)
> > {
> > checkLower = false;
> > if (upperTerm != null)
>
> --C.
>
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-dev-help@jakarta.apache.org>
>


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: Query Rewriting [ In reply to ]
Several Jakarta projects have adopted the integration of Checkstyle
(checkstyle.sourceforge.net) into their builds - which can optionally
fail the build if coding standards are violated.

I highly recommend it!

Erik


Otis Gospodnetic wrote:
> Good IDE :) Spaces are healthier.
> We should standardize and require that, actually.
>
> Otis
>
> --- Clemens Marschner <cmad@lanlab.de> wrote:
>
>>>Please submit diffs.
>>
>>Yeah, I'll do that on the weekend, have to get the latest from CVS
>>(no fast
>>Internet connection today).
>>My IDE converts tabs to spaces when saving. Severe?
>>
>>
>>>@@ -151,7 +151,7 @@
>>> Term term = enum.term();
>>> if (term != null && term.field() == testField)
>>> {
>>>- if (!checkLower ||
>>
>>term.text().compareTo(lowerText) > 0)
>>
>>>+ if (!checkLower ||
>>
>>term.text().compareTo(lowerText) > 0)
>>
>>> {
>>> checkLower = false;
>>> if (upperTerm != null)
>>
>>--C.
>>
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:lucene-dev-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail:
>><mailto:lucene-dev-help@jakarta.apache.org>
>>
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! News - Today's headlines
> http://news.yahoo.com
>
> --
> To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
>
>
>



--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: Query Rewriting [ In reply to ]
Funny, I was just thinking about adding that to the build file.
I use it at work.

Otis

--- Erik Hatcher <lists@ehatchersolutions.com> wrote:
> Several Jakarta projects have adopted the integration of Checkstyle
> (checkstyle.sourceforge.net) into their builds - which can optionally
>
> fail the build if coding standards are violated.
>
> I highly recommend it!
>
> Erik
>
>
> Otis Gospodnetic wrote:
> > Good IDE :) Spaces are healthier.
> > We should standardize and require that, actually.
> >
> > Otis
> >
> > --- Clemens Marschner <cmad@lanlab.de> wrote:
> >
> >>>Please submit diffs.
> >>
> >>Yeah, I'll do that on the weekend, have to get the latest from CVS
> >>(no fast
> >>Internet connection today).
> >>My IDE converts tabs to spaces when saving. Severe?
> >>
> >>
> >>>@@ -151,7 +151,7 @@
> >>> Term term = enum.term();
> >>> if (term != null && term.field() == testField)
> >>> {
> >>>- if (!checkLower ||
> >>
> >>term.text().compareTo(lowerText) > 0)
> >>
> >>>+ if (!checkLower ||
> >>
> >>term.text().compareTo(lowerText) > 0)
> >>
> >>> {
> >>> checkLower = false;
> >>> if (upperTerm != null)
> >>
> >>--C.
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >><mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> >>For additional commands, e-mail:
> >><mailto:lucene-dev-help@jakarta.apache.org>
> >>
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! News - Today's headlines
> > http://news.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:lucene-dev-help@jakarta.apache.org>
> >
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-dev-help@jakarta.apache.org>
>


__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute

--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
RE : Query Rewriting [ In reply to ]
Otis,

If you have looked at the diff I submitted a few minutes ago, I am sure
your point is reinforced. My apologies!


Rasik Pandey

-----Message d'origine-----
De : Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
Envoyé : jeudi 12 septembre 2002 18:24
À : Lucene Developers List
Objet : Re: Query Rewriting


Funny, I was just thinking about adding that to the build file. I use it
at work.

Otis

--- Erik Hatcher <lists@ehatchersolutions.com> wrote:
> Several Jakarta projects have adopted the integration of Checkstyle
> (checkstyle.sourceforge.net) into their builds - which can optionally
>
> fail the build if coding standards are violated.
>
> I highly recommend it!
>
> Erik
>
>
> Otis Gospodnetic wrote:
> > Good IDE :) Spaces are healthier.
> > We should standardize and require that, actually.
> >
> > Otis
> >
> > --- Clemens Marschner <cmad@lanlab.de> wrote:
> >
> >>>Please submit diffs.
> >>
> >>Yeah, I'll do that on the weekend, have to get the latest from CVS
> >>(no fast Internet connection today).
> >>My IDE converts tabs to spaces when saving. Severe?
> >>
> >>
> >>>@@ -151,7 +151,7 @@
> >>> Term term = enum.term();
> >>> if (term != null && term.field() == testField)
> >>> {
> >>>- if (!checkLower ||
> >>
> >>term.text().compareTo(lowerText) > 0)
> >>
> >>>+ if (!checkLower ||
> >>
> >>term.text().compareTo(lowerText) > 0)
> >>
> >>> {
> >>> checkLower = false;
> >>> if (upperTerm != null)
> >>
> >>--C.
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >><mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> >>For additional commands, e-mail:
> >><mailto:lucene-dev-help@jakarta.apache.org>
> >>
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! News - Today's headlines
> > http://news.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:lucene-dev-help@jakarta.apache.org>
> >
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-dev-help@jakarta.apache.org>
>


__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute

--
To unsubscribe, e-mail:
<mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-dev-help@jakarta.apache.org>


--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: Query Rewriting [ In reply to ]
I would prefer a standardized template for the pretty printer of JRefactory,
which can be used stand-alone or from within IDEs (JBuilder, Cafe, Netbeans,
Elixir).
http://jrefactory.sourceforge.net/cspretty.html
I haven't spent a minute on thinking about coding standards since I got
that.
You can write your whole code in one line and still get a perfectly printed
source code.
The output format is highly configurable, and with the sole exception of
anonymous adapter classes (which are sometimes indented a bit strange if you
define them from within a method call) the output is perfect.

--Clemens

----- Original Message -----
From: "Erik Hatcher" <lists@ehatchersolutions.com>
To: "Lucene Developers List" <lucene-dev@jakarta.apache.org>
Sent: Thursday, September 12, 2002 3:25 PM
Subject: Re: Query Rewriting


> Several Jakarta projects have adopted the integration of Checkstyle
> (checkstyle.sourceforge.net) into their builds - which can optionally
> fail the build if coding standards are violated.
>



--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>