Nicolás Lichtmaier wrote:
> Now I know that Nutch doesn't support boolean queries. I've found this:
>
> http://www.mail-archive.com/[email protected]/msg06320.html
>
> But this seems to be for a previous version of Nutch.
>
> Could someone give me a hint about conducting a boolean search by 
> using the Lucene/Nutch API's directly? Just some starting points to 
> look at.
>
> Thanks!
>
>
Hi,

Nutch does not support boolean queries as lucene does. Only the minus 
operator (-) is supported to exclude words from the search. If you want 
boolean query support, then you should modify the Query.java. In this 
class there are subclasses called Clause, Term and Phrase. A clause is 
either a term or a phrase. This class is constructed by the 
Query.parse() method. Parse method delegates to the 
NutchAnalysis.parseQuery(). NutchAnaylsis is generated from 
NutchAnalysis.jj. This JavaCC document lexical analysis and parsing. And 
finally, QueryFilters.filter method run all query filters through the 
Query and these filters convert the nutch Query to lucene BooleanQuery. 
You should definitely check query-basic for this.

To add boolean query support (esp. OR ) you need to modify all the above 
classes in some way : )

Alternatively, you can just construct the Boolean Query and the pass it 
to the index servers bypassing nutch Query class.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nutch-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-general

Reply via email to