[KinoSearch] Using no analyzer with trunk
Marvin Humphrey
marvin at rectangular.com
Thu Apr 9 15:36:19 PDT 2009
On Thu, Apr 09, 2009 at 02:42:42PM -0600, craigknox wrote:
> I am trying to improve the search for http://www.hmdb.ca (which
> currently uses the default polyanalyzer for all searches). The
> problem is that we have a lot of chemical names like CE(20:1(11Z)). So
> when a user searches for CE(20:1(11Z)) without quotes, they get no
> hits because the polyanalyzer tries to do grouping on the search.
Since there's no way to turn off the parenthetical groupings performed by the
core QueryParser, this seems to be a situation where an alternate query
language, supported by an alternate query parser implementation, would be
appropriate.
Producing such a query parser is a bit of work, but I actually wrote a
cookbook entry on the subject:
http://www.rectangular.com/kinosearch/docs/devel/KinoSearch/Docs/Cookbook/CustomQueryParser.html
The FlatQueryParser described there, which supports term queries and phrase
queries, might do just what you need if you take out the support for
PrefixQuery. The finished product can be found in
trunk/perl/sample/FlatQueryParser.pm.
> So I guess I need to have 2 different types of search, a basic search
> which would not use the "grouping" function and an advanced search. I
> am using the trunk version of KinoSearch, and I can't find any
> documentation about how to build an index that will fit the notion of
> a basic (exact) search for names. I found this document: http://www.rectangular.com/kinosearch/docs/devel/KinoSearch/Docs/Tutorial/Analysis.html
> which says how to search without an analyzer, but this code no
> longer works under the trunk build. Is there a way to do this with
> the trunk version?
That document was updated yesterday. It had been out of sync with trunk for a
few weeks before that, though. When did you actually look at it? I think it
ought to work now.
FYI, the API for Schema has been in flux recently; among other changes,
Schema's analyzer() subroutine has gone away.
Marvin Humphrey
More information about the kinosearch
mailing list