lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: How to combine multiple fields to a single field for indexing
Date Mon, 04 Sep 2006 20:06:41 GMT

: How do you set the position increment gap between each addition to the

it does't have an explicit setter, you just subclass that Analyzer of your
choosing and override getPositionIncrementGap to return the value of your
choosing -- it could be a fixed value, or your Analyzer could be
sophisticated and know to put in a larger gap after it sees special marker
values/tokens (ie: a gap of 10 after each "sentence", a gap of 100 after
each "paragraph", a gap of 100 after each "page", ...)

: same field name. Should you set it as high as possible to prevent
: proximity queries from crossing it? I have been looking for the code to
: nearspan, things blow up if you look for something within
: Integer.maximum--sic :) -- Will this be the same case for setting the
: positional gap and if so is there a good max to use to keep a query from
: ever crossing it?

How big of a gap you should use depends entirely on how you want to use it
-- you could say that a gap of "10" is big enough if you know your
application will never ask for phrase/span queries with slop greater then
"10" ... or you could pick 100, or 1000 .. it's entirely up to you; the
question is do you ever *want* your clients to be able to "bridge the
gap"?  if so, then they need to know how big the gap is, if not then they
need to be prevented from asking for slop bigger then the gap.


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

View raw message