lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark harwood <markharw...@yahoo.co.uk>
Subject Re: question about lucene
Date Fri, 01 Jun 2007 13:44:42 GMT
I suspect the Highlighter (in "contrib" section) is what you're after.

There is a patch in JIRA from Mark Miller which adds support for "proper" highlighting of
phrases which I promise to take a look at when I get some time (hang in there Mark!)

----- Original Message ----
From: Will Johnson <wjohnson@GETCONNECTED.COM>
To: java-user@lucene.apache.org
Sent: Friday, 1 June, 2007 2:02:17 PM
Subject: RE: question about lucene

Solr, which is built on top of lucene and adds highlighting among other
features, gets close to what you want.  Check out:

http://wiki.apache.org/solr/HighlightingParameters

- will

-----Original Message-----
From: Erick Erickson [mailto:erickerickson@gmail.com] 
Sent: Friday, June 01, 2007 8:57 AM
To: java-user@lucene.apache.org
Subject: Re: question about lucene

Nope. But here's what I think you can do (although I haven't
tried this exactly, so caveat emptor).

Document doc = new Document();
doc.add("text", line1);
doc.add("text", line2);
doc.add("text", line3);
writer.add(doc);

Now, when searching, you can get the document back and

String[] lines = doc.getValues();

At this point, lines[0] contains line1, lines[1] contains line2, etc.

Perhaps something with Highlighter would work here, or you can
use a MemoryIndex to manipulate them....

But you have some issues here. What is the "correct" line to display if
you search on, say, "Erick AND Tanya" and "Erick" is on one line but
"Tanya" is on another?

Perhaps it would help if you posted a statement of the actual problem
you're trying to solve, there may be other, easier approaches.....

Erick


On 6/1/07, Tanya Levshina <tanya@volvovski.com> wrote:
>
> Wow, it was fast! Thanks. Do you know about any existing application
that
> is
> built on top of lucene that provides this functionality?
>
> Tanya
>
> -----Original Message-----
> From: Erick Erickson [mailto:erickerickson@gmail.com]
> Sent: Friday, June 01, 2007 7:18 AM
> To: java-user@lucene.apache.org
> Subject: Re: question about lucene
>
> No. Lucene is an *engine*, not an app that has a lot of stuff built on
top
> of it out of the box.
>
> You have to index enough information to figure this out somehow.
>
> Best
> Erick
>
> On 6/1/07, Tanya Levshina <tanya@volvovski.com> wrote:
> >
> > Hi,
> >
> >
> >
> > I've just downloaded Lucene, tried demo and looked at the
documentation.
> > The
> > Indexing and Searching work great and fast but  I also need to
display
> all
> > the actual "hits":  the lines from the files that match a particular
> > query.
> > Does Lucene provide means to do it?
> >
> >
> >
> > Thanks a lot,
> >
> >
> >
> > Tanya
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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






      ___________________________________________________________ 
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html


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


Mime
View raw message