lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Haye>
Subject Re: multi-field highlighting
Date Fri, 06 May 2005 21:55:07 GMT
Hi Mark,

Thanks very much for your comments.

> It looks like all queries on the site have to be a span of some
> kind (ie all search terms must appear in the document). Is your
> highlighting code applicable to other modes of querying?

In a sense you're correct, in that the system relies on all leaf queries to be span queries.
Doug's original span code was already set up to report the positional information of hits,
while a normal TermQuery for instance doesn't even iterate the positions. I also added a couple
new span queries to fill out the set: SpanRangeQuery and SpanWildcardQuery.

For complex queries within one field, they're joined with the normal span operators -- SpanOrQuery,
SpanNearQuery, SpanNotQuery, etc. To form a single query across multiple fields, it's the
the usual (non-span-oriented) BooleanQuery.

So to answer your question, the system isn't applicable to queries that don't use spans. But
since we want to highlight based on positional data, that seemed only right.

Someone mentioned a while back modifying the query parser to (optionally?) produce span queries.
This might be another good reason to do so... or are you suggesting something else?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message