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

Olly Betts olly@survex.com
Thu, 27 May 2004 17:29:58 +0100


On Thu, May 27, 2004 at 05:20:52PM +0100, James Aylett wrote:
> 
>   %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];
>     }
>   };
> [...]
> It would be useful to do similar things for stoplist and unstem, even
> if we ignore termlist. We can tidy up for specific languages later.

I wouldn't be averse to hiding the implementation here.  The main reason
it's not already is because the queryparser class was pulled out of
omega and never really cleaned up fully.

The major obstacle is that you end limiting what can be done or exposing
all the container methods via the class API.  For example, just a get
and set pair don't allow you to delete a prefix, delete all prefixes
(i.e. self->prefixes.clear()), iterate through all prefixes, ...

Not all operations are that useful though.  We could look at how omega
uses these members and start from there.

Cheers,
    Olly