lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: How index and search text files in Lucene 3.0.2 ?
Date Fri, 05 Nov 2010 07:37:20 GMT
The default field of query parser is wrong:
QueryParser parser = new QueryParser(Version.LUCENE_30, "computer",
analyzer);

You haven't indexed a field with name "computer". Your query string does not
override the field, so your query is in fact "computer:computer".

A note: It is not recommended to instantiate TopScoreDocCollector directly
for such search cases, just use the IndexSearcher method that returns
TopDocs!

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

> -----Original Message-----
> From: Celso Fontes [mailto:celsowm@gmail.com]
> Sent: Friday, November 05, 2010 3:34 AM
> To: java-user@lucene.apache.org
> Subject: How index and search text files in Lucene 3.0.2 ?
> 
> Hi ! I am newbie in lucene, and i have some problems to create a simple
code
> to query a text file collection.
> 
> My code is this (http://pastebin.com/HqrbBPtp), but does not works.
> What is Wrong?
> 
> Thanks,
> Celso.
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message