lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sirish Vadala <>
Subject RE: Issue with sentence specific search
Date Wed, 06 Oct 2010 20:45:01 GMT

Awesome! Thanks a lot Steven! This is exactly what I wanted.

Hi Sirish,

Have you looked at SpanQuery's yet?:

See also this Lucid Imagination blog post by Mark Miller:

One common technique, instead of using a larger-than-normal position
increment gap between sentences, is using a sentence boundary token like '$'
or something else that won't ever itself be the target of search.  Quoting
from a post Mark Miller made to the lucene-user list last year

	First you inject special marker tokens as your paragraph/
	sentence markers, then you use a SpanNotQuery that looks
	for a SpanNearQuery that doesn't intersect with a
	SpanTermQuery containing the special marker term.

Mark's suggestion would work for your within-sentence case, and for the case
where you don't care about sentence boundaries, you can use SpanNearQuery
without the SpanNotQuery.

Using this technique, a single field should serve all of your needs.

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message