On Tuesday 07 February 2006 22:06, RONALD MANTAY wrote: > Hi, can any one help, I am new to lucene. > > Due to requiring a specific Query syntax, I have created a bespoke query parser to build a boolean query which at any time may comprising a mixture of : > > a) Fuzzy terms with similarity level set according to length of term.text > b) Wild Card Querys > c) Term Querys > > I would like to ability to define if the Query parser terms require to be in Order or not (but when in order to allow gaps in the term positions). > > I can not see see how I can use PhraseQuery or SpanNearQuery directly, can anyone point me in the right direction in how to simulate inOrder to boolean queries.
You could take a look at the test code for these classes, this contains examples on their use (see eg. TestPhraseQuery and the spans directory): http://svn.apache.org/viewcvs.cgi/lucene/java/tags/lucene_1_4_3/src/test/org/apache/lucene/search/ And there is also another query language that has ordered and unordered queries: http://svn.apache.org/viewcvs.cgi/lucene/java/trunk/contrib/surround/ Regards, Paul Elschot --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]