Hello, I was just trying that...
QueryParser qp = new QueryParser("field AND field", new StandardAnalyzer()); Query query = qp.parse("name:\"john\" AND age:[10 TO 16]"); It works fine with this. Do I need to specify that QueryParser should expect things in order "field AND field". Or can I do without it? The static method of QueryParser.parse(String , String, Analyzer) - expects the first string to be the query and second to be the field. Thanks Regards Sunil On Fri, 28 Jan 2005 12:54:27 +0100, David Escuer <[EMAIL PROTECTED]> wrote: > > Hello, > To build queries, you can generate a query like.... "(text:house OR > text:car) AND (keywords:building)", and then > parse it with the QueryParser.parse method to get the Lucene query. > Is not 100% sql-like syntax, but it's more clear > than the lucene syntax. > > Hope it helps > > David > > sunil goyal wrote: > > >Hello all, > > > >I want to run dynamic queries against the lucene index. Is there any > >native syntax available for Lucene so that I can query, by first > >generating the query in say an XML or SQL like format (cache this > >query) and then use this query over lucene index. > > > > > >e.g. So a lucene query syntax in which I can define a query > >(name="john" AND age <10) and then I can just use this query to > >execute over Lucene index. > > > > > >Regards > >Sunil > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]