Hello,

I would like to know if there is a way (in CLucene2.3.3.4) to build a Query* object from a complete Lucene query string, taking into account all of its operators (AND, OR, NOT, +, -, :, (), etc.). Until now, I've been able to use the QueryParser to build fairly simple queries, like this for example :

/*******/
BooleanQuery* lBoolQuery = new BooleanQuery();
Query* lQuery1 = QueryParser::parse( _T( "sampleValue1" ), _T( "sampleField1" ), lAnalyzer ); Query* lQuery2 = QueryParser::parse( _T( "sampleValue2" ), _T( "sampleField2" ), lAnalyzer );

lBoolQuery ->add( lQuery1, true, BooleanClause::MUST );
lBoolQuery->add( lQuery2, true, BooleanClause::MUST );
/*******/

This works ok. But if I've got a complex Lucene string query, like : "title:(test -stuff) AND text:"hello wor*") OR "something nice"^4 ... How can I use this to get a Query* object representing this request ? I'm assuming there is a method to do that, I just can't find it. And I don't want to write a parser myself !

Thanks in advance,

--
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to