You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Guilherme Barile <gu...@prosoma.com.br> on 2003/06/03 17:19:27 UTC

Simple searching ?

Hi
	I'm still getting started with lucene, and I can't search my index (It
exists). I also couldn't find any docs regarding searching, so, if you
could tell me at least this bit is right :

searcher = new IndexSearcher(IndexReader.open(this.indexDir));
hits = searcher.search(QueryParser.parse(query, "content", analyzer));

Do I need anything else ? (The variables and objects are declared, query
is a string)

thanks in advance

gui


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


Re: Simple searching ?

Posted by Bryan LaPlante <bl...@netwebapps.com>.
if you used the indexer from the demo to create your index, try changing the
parse(query, "content", analyzer) to contents instead of content. Also make
sure you are creating an analyzer for the third argument.

Analyzer analyzer = new StandardAnalyzer();

Bryan

----- Original Message -----
From: "Guilherme Barile" <gu...@prosoma.com.br>
To: "Lucene" <lu...@jakarta.apache.org>
Sent: Tuesday, June 03, 2003 10:19 AM
Subject: Simple searching ?


> Hi
> I'm still getting started with lucene, and I can't search my index (It
> exists). I also couldn't find any docs regarding searching, so, if you
> could tell me at least this bit is right :
>
> searcher = new IndexSearcher(IndexReader.open(this.indexDir));
> hits = searcher.search(QueryParser.parse(query, "content", analyzer));
>
> Do I need anything else ? (The variables and objects are declared, query
> is a string)
>
> thanks in advance
>
> gui
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>


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