#467 closed enhancement (fixed)
Add standard ExpandDecider subclass to restrict to terms with a particular prefix
Reported by: | Michel Pelletier | Owned by: | Olly Betts |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.1 |
Component: | Library API | Version: | |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Operating System: | All |
Description (last modified by )
Suggest Enquire.get_eset arguments include 'prefix' that rejects terms early that do not begin with the argument value. My personal use case is to prevent upcalls into the python interpreter, triggering garbage collection, thread switching, signal handling, or whatever else, for what could be a very cheap and early check.
I'm not a C++ programmer by any means, but I think the signature would look something like this:
ESet Enquire::get_eset(Xapian::termcount maxitems, const RSet & rset, int flags, double k, const ExpandDecider * edecider, const string &prefix) const
In python it could be called with a prefix='string' argument.
Change History (7)
comment:1 by , 14 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 1.2.x |
comment:2 by , 14 years ago
I think this could be wrapped into a standard ExpandDecider class that the API provides.
comment:4 by , 14 years ago
Summary: | Extend get_eset() signature to include optional prefix argument → Add standard ExpandDecider subclass to restrict to terms with a particular prefix |
---|
Retitling to reflect the preferred approach.
comment:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 by , 12 years ago
Milestone: | 1.3.x → 1.3.1 |
---|
Note:
See TracTickets
for help on using tickets.
I think the prefix checking would need to be "has term prefix «foo»" rather than a simple string match - otherwise you couldn't usefully use this to select only unprefixed terms, which is likely the most commonly wanted case.
An alternative would be to supply a standard ExpandDecider subclass which restricts to a particular prefix.
Either way it can be done in an upwardly API compatible way, so is suitable for 1.2.x.