Subject: | Linux 2.6.18/perl 5.8.8/Sphinx-Search-0.22 filtering by string attributes |
Date: | Thu, 08 Apr 2010 14:19:09 -0700 |
To: | bug-Sphinx-Search [...] rt.cpan.org |
From: | Tim White <tim.white [...] zulius.com> |
Hi there,
First of all thanks for Sphinx::Search. It's been a big help.
Not that it's been officially released yet, but Sphinx 1.10.1 supports
string attributes. Thus, it will be possible to filter a query by a
string attribute. Currently, filtering by a string causes a croak:
use Sphinx::Search;
my $sphinx = Sphinx::Search->new();
my $r = $sphinx->SetFilter('mystring', ['4bb4afe18d9c4e550798b543']);
Error:
value 4bb4afe18d9c4e550798b543 is not numeric at xsearch.pl line 5
I patched it by commenting out lines 929 - 931 of Sphinx/Search.pm:
=head
foreach my $value (@$values) {
croak("value $value is not numeric") unless ($value =~ m/$num_re/);
}
=cut
Thanks,
Tim