tags:

views:

83

answers:

1

Dear All,

I have a list of all words in the document. I want to index it and latter I want to retrieve a particular word and some near by words (10 words before the result and 10 words after the result).

What is the proper way of indexing and searching in Lucene.net? Please reply me as soon as possible.

Thanking you,

Ashish

+1  A: 

What you want is called KWIC (Key Word in Context). You may use the Lucene.net Highlighter to do this - basically it locates text parts in the document which match the query. You can then use the offsets to add tokens to the left and right of the returned match. Here is a discussion of highlighting in Java Lucene, which may be generalized to Lucene.net.

Yuval F