[KinoSearch] Stemming and Term/TermQuery
Evaldas Imbrasas
evaldas at imbrasas.com
Tue Aug 14 21:18:15 PDT 2007
On 8/14/07, Marvin Humphrey <marvin at rectangular.com> wrote:
>
> On Aug 14, 2007, at 4:19 PM, Evaldas Imbrasas wrote:
>
> > The first series is done using a simple query call:
> > my $hits = $searcher->search(query => 'organic');
> >
> > The second series is done using TermQuery:
> > my $term = KinoSearch::Index::Term->new(title => 'organic');
> > my $by_title = KinoSearch::Search::TermQuery->new(term => $term);
> > my $hits = $searcher->search(query => $by_title);
> >
> > I expect both series to produce the same results, since there's only
> > one field indexed per document.
>
> They will not. The one passing through the Searcher is receiving
> additional processing -- crucially, it is being passed through an
> Analyzer. In the first you are searching for 'organ', which is in
> the index. In the second, you are searching for 'organic', which is
> not.
I see. Is there a way to make the search term in example #2 receive
the same additional processing as in #1?
What I'm trying to do is use several fields to filter the product
search results. Filtering by category or company can be done by simply
stuffing category and company IDs for each indexed item into their
respective fields - they're just numbers, so they're not affected by
the stemming issue. I do the same with the product tags as well, but
apparently tags need to be stemmed before they're passed on to the
filter. (If using such setup is not the optimal way to do the search
filtering, I'd appreciate your advice on this. Not counting the
stemming issue, it seemed to be working just fine though.)
A bonus question - for a new system, would you recommend going with
0.15 or 0.20_04 version?
Thanks for your help Marvin.
--
-----------------------------------------------------
Evaldas Imbrasas
http://www.imbrasas.com
_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
More information about the kinosearch
mailing list