Emma Tonkin > Search-QueryBuilder-0.01 > Search::QueryBuilder

Download:
Search-QueryBuilder-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Search::QueryBuilder - Perl extension for tokenising search strings and building queries

SYNOPSIS ^

  use Search::QueryBuilder;
  my $querybuild=new QueryBuilder;  
  # $querystring contains a query along the lines of "A key phrase" -"keyword" AND keyword +keyword
  my @responsearr=$querybuild->getTokenizedString($querystring);
  # @responsearr contains the keywords and phrases, plus booleans where provided
  
  If you intend to use more than the basic booleans, add them as follows:
  my @mytaglist=("AND","OR","NOT","XOR");
  $querybuild->tags(@mytaglist);

DESCRIPTION ^

QueryBuilder is a very simple tokeniser, designed to decode a query string into something you can create a database query from (into SQL, Cheshire, that sort of thing).

It tries to do a little sanity checking, but is still in active development so expect changes. The creation of queries from the resulting string is partly merged into the module, but expect this interface to change.

EXPORT

None by default.

SEE ALSO ^

There are actually several other modules out there that are related - for example, String::Tokeniser, String::Tokenizer, Parse::Tokens and Text::Tokenizer.

This one is designed specifically for use as part of a search system, and is likely to evolve in that direction (handling of prefixes, building up search queries in various formats and so forth).

Other approaches to this include Search::Circa and Search::QueryParser.

AUTHOR ^

E Tonkin, <cselt@users.sourceforge.net<gt>

COPYRIGHT AND LICENSE ^

Copyright (C) 2006 by E Tonkin

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: