[KinoSearch] Using no analyzer with trunk

Marvin Humphrey marvin at rectangular.com
Sat Apr 11 21:35:14 PDT 2009


On Sat, Apr 11, 2009 at 07:22:52PM -0600, craigknox wrote:
> 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 );

Nice.  :)

> 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'm unable to duplicate this problem so far.  It may only blow up with your
particular Schema.  If you can create a minimal test case in a short script to
demonstrate the bug, that would be helpful. 

I also recommend running the following sequence of commands from trunk/perl:

   ./Build distclean
   svn up ..
   perl Build.PL
   ./Build test
   perl buggy_script.pl

Here's how parsing works for me right now:

marvin at smokey:~/projects/ks/perl $ perl -Mblib -MKinoSearch -e 'my $qp = KinoSearch::QueryParser->new( schema => KinoSearch::Test::TestSchema->new ); KinoSearch::kdump($qp->parse("biosynthesis AND mammalian OR organic)s")->dump)'
$VAR1 = {
  '_class' => 'KinoSearch::Search::ORQuery',
  'boost' => '1',
  'children' => [
    {
      '_class' => 'KinoSearch::Search::ANDQuery',
      'boost' => '1',
      'children' => [
        {
          '_class' => 'KinoSearch::Search::TermQuery',
          'boost' => '1',
          'field' => 'content',
          'term' => 'biosynthesis'
        },
        {
          '_class' => 'KinoSearch::Search::TermQuery',
          'boost' => '1',
          'field' => 'content',
          'term' => 'mammalian'
        }
      ]
    },
    {
      '_class' => 'KinoSearch::Search::PhraseQuery',
      'boost' => '1',
      'field' => 'content',
      'terms' => [
        'organic',
        's'
      ]
    }
  ]
};
marvin at smokey:~/projects/ks/perl $ 

> I even get the same thing if I pass the query into the searcher directly as a
> string.

That makes sense, because if you pass in a query string to Searcher, it uses
an internal QueryParser to parse it.

> 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?

If you are running on Linux, then the easiest way to get more information is
to run a test script under the memory debugger valgrind: 
"valgrind perl foo.pl" instead of "perl foo.pl".

> 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'm pleased to be facilitating your work.  My father, now retired, is a
scientist (in high energy physics).

Marvin Humphrey




More information about the kinosearch mailing list