On Sat, Jan 17, 2015 at 8:58 AM, Nick Wellnhofer <[email protected]> wrote:
> Oops, I just saw that queries for "Foo" don't work either, so scratch that.
> Can you show us your indexing and querying code or even a self-contained
> test case?
The issue is probably that TermQuery's constructor takes exactly what you give
it, which may not match what's in the index. In this case, `foo` is in the
index, so queries for `Foo` don't work.
A QueryParser will probably give Gerald what he wants, because it will apply
the appropriate Analyzer.
use Lucy;
use Data::Dumper qw( Dumper );
my $searcher = Lucy::Search::IndexSearcher->new(index => '/path/to/index');
my $qparser = Lucy::Search::QueryParser->new(
schema => $searcher->get_schema,
fields => ['content'], # optional, try without this.
);
my $query = $qparser->parse("Foo");
warn Dumper($query->dump);
Marvin Humphrey