lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <>
Subject Re: search result and highlighting
Date Sat, 08 Oct 2011 18:32:56 GMT
On Sat, Oct 8, 2011 at 4:55 AM, sprateek <> wrote:

> Hello All,
> If a particular document contains N occurance of Search term then I was to
> show it as N results in Search result page.  For example if I am searching
> for word 'Hello' and my document contains this word three times then in
> search result it should be shown three times (As different results). I also
> want that in first result only furst hello should be highlighted and second
> result second hello should be highlighted and in third one third hello
> should be.
> Please let me know if its possible with Lucene or not.
Yes.  But it will require that you do a bit of coding.

You can pretty easily scan the original result list (of documents each
mentioned once) and create a new list where each match in each document is
mentioned separately.

There isn't anything that does this naturally that I have ever heard of.
 This need is really a function of the presentation layer rather than of the
search layer.

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