lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Celso Fontes <cels...@gmail.com>
Subject Re: How index and search text files in Lucene 3.0.2 ?
Date Fri, 05 Nov 2010 16:01:06 GMT
Thanks Uwe, its works with:

            QueryParser parser = new QueryParser(Version.LUCENE_30,
"content:computer", analyzer);
            Query query = parser.parse("content:computer");

But, if i need get results like google in a query like "What is the
role of PrnP in mad cow disease?"

Thanks
CElso.

2010/11/5 Uwe Schindler <uwe@thetaphi.de>:
> 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
>
>

---------------------------------------------------------------------
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