On Wed, Jan 27, 2010 at 4:53 PM, Asif Nawaz <asifna...@hotmail.com> wrote:
>
>
> IndexSearcher is = new IndexSearcher("index");IndexReader ir = 
> is.getIndexReader().open("index");System.out.println("No of documents in 
> index = "+ir.numDocs());
> The last statement shows no of documents = 167. that means IndexReader is 
> reading from index, which is open. I think the problem may exists in query 
> parser. I am using following code
> QueryParser parser = new QueryParser("content", analyzer);                    
>     Query query = parser.parse(queryString);        Hits hits = 
> is.search(query);
>
I don't see the field "content" in your document you build in the
first mail. What do you search for? remember if you do not specifiy a
field in you querystring the parser will use the default  field which
is "content". Could that cause your problem?

simon
>
>
>
>> Date: Wed, 27 Jan 2010 12:47:57 +0100
>> Subject: Re: Index searching problem
>> From: simon.willna...@googlemail.com
>> To: java-user@lucene.apache.org
>>
>> Do you open the searcher  / reader after you call commit on the writer?
>>
>> simon
>
>
>
>
> _________________________________________________________________
> Hotmail: Trusted email with powerful SPAM protection.
> https://signup.live.com/signup.aspx?id=60969

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

Reply via email to