Erik Hatcher sagte:
> On Jan 7, 2004, at 4:18 PM, Dror Matalon wrote:
>> Actually I would guess that performence should be fine. I would look at
>> the code generated by the standard analyzer,
>> http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/analysis/
>> standard/package-summary.html
>> which translates from "(a AND b) OR c" to "+a +b c" and then see what
>> it does with it.
>
> Huh?  StandardAnalyzer does not do that type of translation.
> QueryParser is what parses "(a AND b) OR c" into a nested BooleanQuery.
>
> Query.toString is what will visually turn it into the +/- view.

OK, I've looked inside QueryParser and it's seems to be the right place to
do that. But it's rather complicated to transform a query to another,
since QueryParserTokenManager as an extreme example is not quite
understandable and needs a huge time for all that stuff to work in.

Here's my progress. First I grab all values for "DocID" in the lucene
index. This seems to work well after a sample earlier in this mailing
list.
For every "DocID" I want to search for the submitted query. Therefor I
need to transform the queries after the following rule:

"foo bar" --> +DocID:inserthere +"foo bar"

foo bar --> (+DocID:inserthere +foo) AND (+DocID:inserthere +bar)

foo -bar --> (+DocID:inserthere +foo) AND (+DocID:inserthere -bar)

I think this should do the trick, since (foo bar) should be understand as
a query for "foo" and "bar" must be in the document. So a relative simple
syntax of my queries need only little adaptation to run with lucene I
think. But of cause I don't know how to transform above styled queries.

Any help on this topic available?

Thank you.

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to