Ignore:
Timestamp:
2006-09-18T14:32:31+12:00 (18 years ago)
Author:
mdewsnip
Message:

Changed the Lucene "-fuzzy" argument to "-fuzziness <value>", for more accurate control.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/lucene_query.pl

    r12656 r12770  
    4444{
    4545    my $full_indexdir = shift(@_);
    46     my $fuzzy = shift(@_);
     46    my $fuzziness = shift(@_);
    4747    my $filter_string = shift(@_);
    4848    my $sort_field = shift(@_);
     
    5656
    5757    my $cmd = "| " . $java_lucene . " \"" . $full_indexdir . "\"";
    58     if (defined($fuzzy)) {
    59         $cmd .= " -fuzzy";
     58    if (defined($fuzziness)) {
     59        $cmd .= " -fuzziness " . $fuzziness;
    6060    }
    6161    if (defined($filter_string)) {
     
    9494    my $argc = scalar(@argv);
    9595    if ($argc == 0) {
    96     print STDERR "Usage: $PROGNAME full-index-dir [query] [-fuzzy] [-filter filter_string] [-sort sort_field] [-dco AND|OR] [-startresults number -endresults number] [-out out_file]\n";
     96    print STDERR "Usage: $PROGNAME full-index-dir [query] [-fuzziness value] [-filter filter_string] [-sort sort_field] [-dco AND|OR] [-startresults number -endresults number] [-out out_file]\n";
    9797    exit 1;
    9898    }
     
    100100    my $full_indexdir = shift(@argv);
    101101    my $query = undef;
    102     my $fuzzy = undef;
     102    my $fuzziness = undef;
    103103    my $filter_string = undef;
    104104    my $sort_field = undef;
     
    109109    for (my $i = 0; $i < scalar(@argv); $i++)
    110110    {
    111     if ($argv[$i] eq "-fuzzy") {
    112         $fuzzy = 1;
     111    if ($argv[$i] eq "-fuzziness") {
     112        $i++;
     113        $fuzziness = $argv[$i];
    113114    }
    114115        elsif ($argv[$i] eq "-filter") {
     
    141142    }
    142143
    143     open_java_lucene($full_indexdir, $fuzzy, $filter_string, $sort_field, $dco, $start_results, $end_results, $out_file);
     144    open_java_lucene($full_indexdir, $fuzziness, $filter_string, $sort_field, $dco, $start_results, $end_results, $out_file);
    144145
    145146    if (defined $query) {
Note: See TracChangeset for help on using the changeset viewer.