| 1 | #!/usr/bin/perl
|
|---|
| 2 |
|
|---|
| 3 | use strict;
|
|---|
| 4 | use warnings;
|
|---|
| 5 |
|
|---|
| 6 | use Search::Xapian qw(:standard); # libsearch-xapian-perl 1.0.4.0-2 from Debian unstable
|
|---|
| 7 |
|
|---|
| 8 | $|=1;
|
|---|
| 9 |
|
|---|
| 10 | # These all work:
|
|---|
| 11 | test_query('something other* this more');
|
|---|
| 12 | test_query('other* this AND more');
|
|---|
| 13 | test_query('something other this AND more');
|
|---|
| 14 | test_query('something other* this more');
|
|---|
| 15 |
|
|---|
| 16 | # This query throws a Xapian::QueryParserError and core dumps:
|
|---|
| 17 | test_query('something other* this AND more');
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 | sub test_query {
|
|---|
| 21 | my ($q)=@_;
|
|---|
| 22 |
|
|---|
| 23 | print "'$q' ";
|
|---|
| 24 |
|
|---|
| 25 | my $query_parser=Search::Xapian::QueryParser->new;
|
|---|
| 26 |
|
|---|
| 27 | $query_parser->parse_query($q, FLAG_BOOLEAN|FLAG_WILDCARD);
|
|---|
| 28 |
|
|---|
| 29 | print "[ok]\n";
|
|---|
| 30 | }
|
|---|