Omgili, forum search, forums search, search forums, discussion search,discussions search, search discussions, board search, boards search, search boards
  Advanced Search

Searching a string using lucene

On Tue, 31 Jan 2012 10:50:10 -0500, Dave Seltzer <...@tveyes.com

Hello,

I’m having a bit of trouble Googling this, so I’m hoping someone can point
me in the right direction.

We have a system which generates blocks of text which need to be searched
as they come in. I was hoping I could use Lucene’s query parser and
analyzer to search a block of text for a series of searches. This example (
http://javatechniques.com/blog/lucene-in-memory-text-search-example/ ) is
similar to what I want to do, only I’m only interested in searching one
document at a time.

Is my best bet to create an in-memory index, search it, and then throw it
away? Is this fast enough to do a hundred times a second?

Or am I better off using the Highlighter to find out if the document
contains a hit?

Or is there a third, more-awesome, way of doing this?

Thanks much!

-Dave



On Tue, 31 Jan 2012 10:59:47 -0500, Stephen Howe <...@gmail.com

Have you taken a look at the MemoryIndex?
http://lucene.apache.org/java/3_5_0/api/all/index.html See in particular:

If you have all your queries predefined, this could be a pretty fast way to
get where you want to go.

Stephen
On Tue, Jan 31, 2012 at 10:50 AM, Dave Seltzer <...@tveyes.com

On Tue, 31 Jan 2012 17:05:36 -0500, Dave Seltzer <...@tveyes.com

Hi Stephen,

That is precisely what I was looking for! Thanks very much!

-Dave

-----Original Message-----
From: Stephen Howe [mailto:]
Sent: Tuesday, January 31, 2012 11:00 AM
To: java...@lucene.apache.org
Subject: Re: Searching a string using lucene

Have you taken a look at the MemoryIndex?
http://lucene.apache.org/java/3_5_0/api/all/index.html See in particular:

tokens
MemoryIndex:
always,

If you have all your queries predefined, this could be a pretty fast way
to
get where you want to go.

Stephen
On Tue, Jan 31, 2012 at 10:50 AM, Dave Seltzer <...@tveyes.comwrote:

point
searched
example (
is
it

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

On Tue, 31 Jan 2012 17:09:23 +0100, "Uwe Schindler" <...@thetaphi.de

MemoryIndex only allows *one* document! So it is mostly for lookup if a term
is contained in a document and where (used internally by the highlighter).

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uw...@thetaphi.de

to get
wrote:
one

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

Discussion Title: Searching a string using lucene
Title Keywords: Searching  string  using  lucene