> I have 3 questions: > > 1) XML query parser just focuses on the "difficult" queries, left the > "simple" ones to the standard query parser. > I think it'll be good to support all of the queries. Makes it easier to > implement, rather than combine two different parser together.
"Lucene in Action 2" contains a section on XML query parser with an example that is typical of its use. An HTML form for a job search is mapped to an XML query via XSL. The free-text field for a job description accepts standard Lucene query syntax and gets mapped to a <UserQuery> tag - the other form content is all structured e.g date ranges, salary bands, contract/permanent choices and location choices - these all get mapped to specialised tags in the XML. Phrase, Wildcard etc are happily handled by the UserQuery tag and it makes perfect sense for these elements to mix in the same XML. I could easily add Phrase, wildcard etc as explicit XML tags but there's not a great deal of demand for that so far and it may give people the wrong ideas. > 2) Another side point is the lack of examples in the Javadoc. Currently I > need to dig into the unit test part to find some examples. In the source distro the contrib/xml-query-parser/docs directory has extensive docs with examples. These are generated from comments held in a formal DTD > 3) Can this be "standardized" into Lucene trunk? Is it possible to support > other serialization forms, like google protocol buffer? Hopefully I only need > to serialize it via query.toXML() or query.toBytes() and the parser can > recognize the serialized forms. I'm not sure about requiring query objects to serialize to XML or putting in trunk. It seems like a bit of a burden to place on core code for all query objects. It also enforces a single XML representation whereas the parser has been designed to support multiple new tags easily e.g. you can plug in simple tag handlers for tags like <All> ...</All> or <Any>....</Any> if you wanted a simplified form of expressing Boolean logic containers in the XML. Cheers Mark > > -- > Chris Lu > ------------------------- > Instant Scalable Full-Text Search On Any Database/Application > site: http://www.dbsight.net > demo: http://search.dbsight.com > Lucene Database Search in 3 minutes: > http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes > DBSight customer, a shopping comparison site, (anonymous per request) got 2.6 > Million Euro funding! > > > > Mark Harwood wrote: >> Yes it is being maintained and I have it in production on many large >> systems. Phrase prefix wildcard etc can be supported using the "UserQuery" >> tag which hands off to the regular Lucene QueryParser. It would be easy to >> add XML tags for these types but these clauses tend to be provided by users >> anyway as part of free-text fields. The other XML syntax tends to be useful >> for capturing all the other structured input eg date ranges, checkboxes etc >> as filters or caches filters. I intend to give it a 3.0 refresh to add geo >> etc soon >> --------------------------------------- >> >> On 18 Feb 2010, at 02:12, Chris Lu <chris...@gmail.com> wrote: >> >> XMLQueryParser is pretty good start. However, is it being maintained >> recently? >> >> I noticed many Query class are not supported, like PrefixQuery, or even >> PhraseQuery. >> Is it for some particular reason or simply lack of resource? >> >> -- >> Chris Lu >> ------------------------- >> Instant Scalable Full-Text Search On Any Database/Application >> site: http://www.dbsight.net >> demo: http://search.dbsight.com >> Lucene Database Search in 3 minutes: >> http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes >> DBSight customer, a shopping comparison site, (anonymous per request) got >> 2.6 Million Euro funding! >> >> >> Mark Harwood wrote: >> This was part of the rationale for creating the XMLQueryParser which can be >> found in contrib. >> >> See here for the background: >> http://marc.info/?l=lucene-dev&m=113355526731460&w=2 >> >> >> On 17 Feb 2010, at 18:44, Aaron Schon wrote: >> >> Hi all, I know that persisting a Lucene query by query ToString() method. Is >> there any way of reconstructing the query from the string itself? >> The usecase is that I will be storing a library of queries as strings and >> load the appropriate query (from the string) based on some conditions. >> >> Is this possible? Could you share a code snippet? >> >> p.s. apologies for the double posting (I had asked this on Lucene general >> and was asked to ask here instead) >> >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-user-h...@lucene.apache.org >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-user-h...@lucene.apache.org >> >> >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-user-h...@lucene.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org