[KinoSearch] Using no analyzer with trunk
craigknox
craigknox at gmail.com
Sat Apr 11 18:22:52 PDT 2009
Hi Marvin,
Thanks for your quick reply. I managed to get a "FlatQueryParser"
working properly, so that the grouping is turned off when there is a
closing brace followed by a non-word-boundary:
my $parser = $q =~ /\)\B/ ? NameQueryParser->new( schema =>
$schema ) : KinoSearch::QueryParser->new( schema => $schema );
This seems to work great with my custom NameQueryParser class.
However, now that I have committed to using the trunk release I am
running into another small problem.
As I was testing the new code, I tried the following query:
biosynthesis AND mammalian OR organic)s
This results in a "bus error" regardless of whether I use my
NameQueryParser class or the standard KinoSearch::QueryParser. I even
get the same thing if I pass the query into the searcher directly as a
string.
I imagine from the error message that this is a C error, but I am
completely unfamiliar with C. Is there a way to get more information
back about what is going on?
Thanks for all your help. You might be interested to know that
KinoSearch was mentioned in our last paper with the HMDB (http://www.ncbi.nlm.nih.gov/pubmed/18953024
). I think the work you are doing is fantastic.
Craig
On 9-Apr-09, at 4:36 PM, Marvin Humphrey wrote:
> 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
>
>
>
> _______________________________________________
> kinosearch mailing list
> kinosearch at rectangular.com
> http://rectangular.com/cgi-bin/mailman/listinfo/kinosearch
More information about the kinosearch
mailing list