A question.
OK, so I have these fields:
title
introtext
Both are keyword-searched against. If I search "+foo +bar" though, then
how can I get results that will find foo in one, and bar in another?
Like, I can do something like this:
(title:foo AND (title:bar OR introtext:bar)) OR (title:bar AND (title:foo
OR introtext:foo))
But that gets messy very quickly, and I have a whole bunch of fields, not
just the two. I can combine the fields, but if we want to give one field a
boost later, that becomes a problem.
Right now my code looks like:
for my $field (@fields) {
my $query_parser = KinoSearch::QueryParser::QueryParser->new(
analyzer => $analyzer,
default_field => $field,
);
$query->add_clause(query =>
$query_parser->parse($querystring));
}
I know in the next version I can do, simply:
my $query_parser = KinoSearch::QueryParser::QueryParser->new(
analyzer => $analyzer,
fields => \@fields,
);
Will that search across all the fields as I want? Or is there another way?
--
Chris Nandor pudge@pobox.com http://pudge.net/
Open Source Technology Group pudge@ostg.com http://ostg.com/
OK, so I have these fields:
title
introtext
Both are keyword-searched against. If I search "+foo +bar" though, then
how can I get results that will find foo in one, and bar in another?
Like, I can do something like this:
(title:foo AND (title:bar OR introtext:bar)) OR (title:bar AND (title:foo
OR introtext:foo))
But that gets messy very quickly, and I have a whole bunch of fields, not
just the two. I can combine the fields, but if we want to give one field a
boost later, that becomes a problem.
Right now my code looks like:
for my $field (@fields) {
my $query_parser = KinoSearch::QueryParser::QueryParser->new(
analyzer => $analyzer,
default_field => $field,
);
$query->add_clause(query =>
$query_parser->parse($querystring));
}
I know in the next version I can do, simply:
my $query_parser = KinoSearch::QueryParser::QueryParser->new(
analyzer => $analyzer,
fields => \@fields,
);
Will that search across all the fields as I want? Or is there another way?
--
Chris Nandor pudge@pobox.com http://pudge.net/
Open Source Technology Group pudge@ostg.com http://ostg.com/