On Jan 25, 2006, at 6:39 AM, Gwyn Carwardine wrote:

Yes I think you're right. On reading the "lucene in action" chapted on
highlighting I found it squirreled in the middle of the text. I get
the
feeling that whilst I have so far found query parser to be the primary
method of building queries that this is not ht eprimary method used
by other
people. Otherwise I would have expected to see the first example in
the book
use query parser. So what I'm not quite sure is how come the norm
is using
the direct queries.

Highlighting and QueryParser aren't related.  How you build or
generate the Query object is irrelevant to the Highlighter.

It is true that in my applications, use of QueryParser is only a
small piece of how the Query gets built and in one project I've
created an entirely different and custom expression parser (for
legacy syntax compatibility reasons, as well as to support
sophisticated SpanQuery constructions).

I believe the first example in Lucene in Action does use QueryParser,
the Searcher.java code in Chapter 1.

        Erik

Hi Erik, from my point of view Highlighter and QueryParser ARE related when talking about the process of highlighting. If you've generated your Query through the use of QueryParser then you really must call the Query.Rewrite before you pass the query to the scorer which goes on to the highlighter.

Again, it doesn't matter about how the Query was created. It is important to call rewrite on it to have queries that expand to expand themselves into primitive queries such that the exact terms can be extracted by the Highlighter. For example, if you create a WildcardQuery yourself without the parser, you'll still need to call rewrite to have the terms expanded.

When I said the first example what I meant was the first example in section 8.7 "Highlighting query terms". It looks like a very simple example but for me it was not a realistic example. When I see these things I want to cut and
paste and use as a starting point but in this case it didn't do what I
expected and I ended up confused..

That's a fair critique. I agree that this example was not entirely realistic for cut-and-paste, and the coverage of having to do a rewrite was barely mentioned in the text. I'll note this for improvement in the 2nd edition (which hopefully will get started in the next couple of months).

Please take my comments as constructive feedback solely from my perspective.
Please do not take it as criticism of your excellent book!

Thank you!

        Erik


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

Reply via email to