[KinoSearch] KinoSearch: Patch extending query language in 0.15.

Marvin Humphrey marvin at rectangular.com
Thu Sep 6 16:33:17 PDT 2007




On Sep 6, 2007, at 4:07 PM, Matthew O'Connor wrote:

> Marvin, (resending to list)

Thanks, I definitely prefer to handle this sort of thing out in the  
public forum.  :)

> So if I have field "foo" and terms "bar" and "baz" then "foo:(bar  
> baz)" is equivalent to "(foo:bar foo:baz)".  The expression "foo: 
> (bar baz)" formerly had no semantics, but my implementation seems  
> like a reasonable interpretation.

I think this is a very nice improvement in terms of consistency.

I see that your patch also adds a second argument to the public API  
of QueryParser->parse:


  =head1 METHODS
@@ -373,12 +377,16 @@

  =head2 parse

-    my $query = $query_parser->parse( $query_string );
+    my $query = $query_parser->parse( $query_string, $fields );

  Turn a query string into a Query object.  Depending on the contents  
of the
  query string, the returned object could be any one of several  
subclasses of
  L<KinoSearch::Search::Query|KinoSearch::Search::Query>.

+The default fields to search are taken from the C<$fields>  
arrayref.  If this
+is not passed in then the default fields from the query parser  
object are
+used.
+
  =head1 COPYRIGHT


The underlying functionality is needed because of how your patch  
works (kudos on its simplicity and elegance, BTW), but I think we  
ought to leave that second argument private.  It's not needed because  
the constructor allows you to specify custom fields already and we're  
just duplicating that functionality.  If you really need to set up  
custom fields, you can create multiple QueryParser objects -- they  
aren't cumbersome.

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



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




More information about the kinosearch mailing list