Hi There,
I am not sure if this is quite what you are looking for....but you
can use the SETRANGE feature of a cursor together with a special
comparitor to do partial matches. This would allow you to search
through all matches only of a particular prefix match (defined by your
comparitor). It would then be up to you to decide which of the
matching keys within the returned range is the one you were looking
for.
http://www.sleepycat.com/docs/api_cxx/dbc_get.html
Sorry if this is off-base from your question. Its the only thing that
I am aware of that comes close.
-Greg
Florian Weimer wrote:
Quote:
Does Berkeley DB support a lookup method on BTREE databases which
returns the key/data pair whose key is a prefix of the lookup key, and
the longest key with this property?
Maybe I'm missing something and this can be implemented using a
special user-defined comparison function?
(Yes, this is the IP forwarding problem, but it does show up in other
contexts, too. 8-) |