You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Reuven Ivgi <Re...@intellinx-sw.com> on 2006/10/03 09:32:15 UTC

Define end-of-paragraph

Hello,

I have just started to work with Lucene

I want to divide a document to paragraphs, still having proximity search
within each paragraph

How can I do that?

Thanks in Advance

 

 

Reuven Ivgi

 


Re: Define end-of-paragraph

Posted by Chuck Williams <ch...@manawiz.com>.
Reuven Ivgi wrote on 10/02/2006 09:32 PM:
> I want to divide a document to paragraphs, still having proximity search
> within each paragraph
>
> How can I do that?
>   

Is your issue that you want the paragraphs to be in a single document,
but you want to limit proximity search to find matches only within a
single paragraph?  If so, you could parse your document into paragraphs
and when generating tokens for it place large gaps at the paragraph
boundaries.  Each Token in lucene has a startOffset and endOffset that
you can set as you generate Tokens inside TokenStream.next() for the
TokenStream returned by your Analyzer.  Those classes and methods are
all in org.apache.lucene.analysis.  Or alternatively, you could make
each paragraph a separate field value and use
Analyzer.getPositionIncrementGap() to achieve essentially the same thing
(except that your Documents could get unwieldy if you that have many
paragraphs).

If this is not what you are trying to do, then please explain your
objectives precisely.

Good luck,

Chuck


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org