You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Michael A. Schoen" <sc...@earthlink.net> on 2004/03/03 18:53:23 UTC

Fw: [Plucene] Plucene::Plugin::WeightedQueryParser

This recently submitted query parser for Plucene (the perl port of lucene)
seems very handy.

Does something similar already exist for Lucene? Any volunteers? It seems
like a pretty straightforward extension to MultiFieldQueryParser.

----- Original Message ----- 
From: "Simon Cozens" <si...@simon-cozens.org>
To: <pl...@kasei.com>
Sent: Monday, February 23, 2004 6:40 AM
Subject: [Plucene] Plucene::Plugin::WeightedQueryParser


> NAME
>     Plucene::Plugin::WeightedQueryParser - Specify weights for unqualified
>     terms
>
> SYNOPSIS
>       use Plucene::Plugin::WeightedQueryParser;
>       my $parser = Plucene::WeightedQueryParser->new({
>               analyzer =>
Plucene::Plugin::Analyzer::PorterAnalyzer->new(),
>               weights  => {
>                 title => 5,
>                 subtitle => 2,
>                 body => 1
>               }
>       });
>       $parser->parse($q);
>
> DESCRIPTION
>     Quite often, you want unqualified search terms ("hello") to search in
>     either the title, the body or some other part of you document. The
usual
>     way to do this is to create another field, "content", and throw
>     everything in that, then make that the default field for unqualified
>     terms.
>
>     That's fine, until you want to add different weighting for terms - so
>     terms found in the title of a document come first, then those in the
>     subtitle, then the body of the document.
>
>     This module automatically remaps unqualified search terms, such as
>     "hello" to "(title:hello^5 OR subtitle:hello^2 OR body:hello^1)",
based
>     on the weights passed in to the constructor.
>
> AUTHOR
>     Simon Cozens, "simon@cpan.org"
>
>     Development of this module was made possible by the generous
sponsorship
>     of Text Matters, http://www.textmatters.com/
>
>     This module may be distributed under the same terms as Plucene itself.
>
> -- 
> For detailed information on the "info" command, type "man info".
>     - plan9 has a bad day
> _______________________________________________
> Plucene mailing list
> Plucene@kasei.com
> http://www.kasei.com/mailman/listinfo/plucene


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org