lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <simon.willna...@googlemail.com>
Subject Re: Index searching problem
Date Wed, 27 Jan 2010 15:59:13 GMT
On Wed, Jan 27, 2010 at 4:53 PM, Asif Nawaz <asifnawaz@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.willnauer@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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message