[Xapian-discuss] Query::Query() in PHP, also QueryParser::prefixes

Francis Irving francis@flourish.org
Fri, 28 May 2004 12:10:14 +0100


On Thu, May 27, 2004 at 05:20:52PM +0100, James Aylett wrote:
> You could probably do something like (warning: untested!):
> 
> class QueryParser {
>   public:
>   QueryParser();
>   void set_stemming_options(const string &lang, bool stem_all_ =
>   false,
>                                   Stopper *stop_ = NULL);
> 
>   void set_default_op(Query::op default_op_);
>   void set_database(const Database &db_);
>   Query parse_query(const string &q);
> 
>   %extend {
>     void set_prefix(const std::string &name, std::string value) {
>       self->prefixes[name] = value;
>     }
> 
>     std::string get_prefix(const std::string &name) {
>       return self->prefixes[name];
>     }
>   };
> };

That works!  And seems a good interface.  Thank you.

Francis