Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: kinosearch: discuss

Using QueryFilter and TermQuery

 

 

kinosearch discuss RSS feed   Index | Next | Previous | View Threaded


riyaad.miller at predix

Jul 21, 2008, 8:03 AM

Post #1 of 2 (1455 views)
Permalink
Using QueryFilter and TermQuery

Hi All

I'm using KinoSearch-0.162. When doing a search for a single word
($Source), KS returns the correct results.
However when doing so for a string of words (eg. $Source = "foo foo foo
blah blah") it returns no results at all.
NB. 'site' has been indexed correctly. Could any please assist regarding
this?

my $SiteOnly = KinoSearch::Search::TermQuery->new( term =>
KinoSearch::Index::Term->new( 'site', $Source ) );
my $filter = KinoSearch::Search::QueryFilter->new( query => $SiteOnly );

$hits = $searcher->search(
query => $query,
filter => $filter
);

...


Appreciated
Riyaad

_______________________________________________
KinoSearch mailing list
KinoSearch [at] rectangular
http://www.rectangular.com/mailman/listinfo/kinosearch


marvin at rectangular

Jul 22, 2008, 7:49 PM

Post #2 of 2 (1338 views)
Permalink
Re: Using QueryFilter and TermQuery [In reply to]

On Jul 21, 2008, at 8:03 AM, Riyaad Miller wrote:

> However when doing so for a string of words (eg. $Source = "foo foo
> foo blah blah") it returns no results at all.
> NB. 'site' has been indexed correctly. Could any please assist
> regarding this?

The problem is that TermQuery's constructor applies raw text. It
doesn't parse.

> my $SiteOnly = KinoSearch::Search::TermQuery->new( term =>
> KinoSearch::Index::Term->new( 'site', $Source ) );

Try using field-specific QueryParsers. In 0.162...

my $site_only_parser = KinoSearch::QueryParser::QueryParser->new(
analyzer => $analyzer,
fields => ['site'],
);
my $site_only = $site_only_parser->parse($site_qstring);
...

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/


_______________________________________________
KinoSearch mailing list
KinoSearch [at] rectangular
http://www.rectangular.com/mailman/listinfo/kinosearch

kinosearch discuss RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.