Matt Goodall
2010-Jun-06 10:23 UTC
[Xapian-discuss] Using QueryParser results to populate UI
Hi, I would like to "pull apart" a search string to populate distinct search fields in a UI; something like how Google toggles between simple and advanced search modes. I realise going from simple to advanced may well be lossy but that's fine for my purposes. I thought the obvious place to start was xapian's QueryParser. Unfortunately, Query instances appear to be a little opaque, at least from the Python bindings. Am I missing something obvious or will I need my own xapian-like query parser to do what I want? Thanks, Matt
Matt Goodall
2010-Jun-06 10:30 UTC
[Xapian-discuss] Using QueryParser results to populate UI
On 6 June 2010 11:23, Matt Goodall <matt.goodall at gmail.com> wrote:> Hi, > > I would like to "pull apart" a search string to populate distinct > search fields in a UI; something like how Google toggles between > simple and advanced search modes. I realise going from simple to > advanced may well be lossy but that's fine for my purposes. > > I thought the obvious place to start was xapian's QueryParser. > Unfortunately, Query instances appear to be a little opaque, at least > from the Python bindings. Am I missing something obvious or will I > need my own xapian-like query parser to do what I want?Incidentally, if anyone has already written a query parser in Python that I can use then I'd be extremely grateful! I need to support: * word and phrase terms * AND, implicit, e.g. "one two", and explicit, e.g. "one AND two" * OR * NOT, -expr prefix and/or NOT expr * bracketed expressions * field prefixed searches, e.g. title:"xapian" I've actually got something using pyparsing fairly close but I'm having trouble making it support implicit AND at the moment. - Matt
Possibly Parallel Threads
- Searching using prefixes
- How to make QueryParser select entire word like "H.O.T"
- [issue] The difference between QueryParser::FLAG_AUTO_SYNONYMS and QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS
- queryparser dies badly on double search words.
- QueryParser lowercase / uppercase and stemming