Re: [bdbxml] Regular expressions in bdbxml
Dan Brian <[email protected]> Thu, 18 Aug 2005 09:19:46 -0600
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
Gregory Burd wrote: > Thanks for raising this issue. How important is this feature? > I happen to think that this will be a common use case. If you do too > (this is a general question for the list not just Adam), drop me some > email and let me know. The question is: > > "Should Berkeley DB XML support an index type that optimizes access > to data using regular expressions?" It's impossible for any regular expression index to provide lookup speed close to the current index types. All they can do is dramatically lessen the set size for which the regular expression must be executed against each record. And even then, it's usually just for POSIX 1003.2 regexes, as opposed to PCRE, and implementing "multigram" indexes is not a small job. But, yes, this would be a nice feature. :-) Adam Rambousek wrote: >> Multi-lingual lexicography is my main field of activity, and I >> don't think >> bdxml is suitable for it yet, precisely because it doesn't (yet) >> provide the >> granularity of indexing that complex queries against highly- >> structured >> lexical data require. However, the road-mapped developments in >> forthcoming >> versions will change that dramatically (and I had rather assumed >> that regex >> support would be built into the extensions to current indexing >> methods that >> those developments entail). For now, though, of the open-source >> native XML >> databases, I find that only eXist has the sub-document level >> indexing power >> and flexibility that my dictionary applications require. Adam - I use BDB XML for a similar application to yours, and we don't need regexes. Substring are adequate to do most of our queries (where we are looking up words). The exception is if you want to look up misspelled queries. You can use substrings to search for word prefixes and suffixes, partial matches, and multiple word matches (each as a "subquery"). Keep in mind too that since you are generating this XML, you can be selective about how your data looks. In our case, each word in a lexicon entry goes into its own XML element, making it easy to do equality and in very few cases substring queries in the collection. Regards, Dan ------------------------------------------ To remove yourself from this list, send an email to [email protected]