lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doron Cohen" <>
Subject Re: multiple instances of fields or attributes
Date Tue, 12 Feb 2008 19:01:02 GMT
On Thu, Feb 7, 2008 at 6:03 PM, André Warnier <> wrote:

> ...
> Does anyone have an example of how this works ?
> (or an explanation in plain French-speaker-friendly tutorial-like English
> ?)

Do you mean "how to make it work for you" or "how does it work inside"?
The first option is easier to explain (though I know no French :))
When you create an IndexWritier you provide it an Analyzer.
That analyzer is used when a document is added to the index.
The analyzer.getPositionIncrementGap() specifies the position
gap between separate additions of same field. By default it
returns 0 (which is not working well in your example). To modify this
you can override this method in "your" analyzer to return a nonzero gap,
for example 5. This is easy when subclassing any existing analyzer.


> Thanks,
> André

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message