On Monday 22 November 2004 05:02, Kauler, Leto S wrote: > Hi Lucene list, > > We have the need for analysed and 'not analysed/not tokenised' clauses > within one query. Imagine an unparsed query like: > > +title:"Hello World" +path:Resources\Live\1 > > In the above example we would want the first clause to use > StandardAnalyser and the second to use an analyser which returns the > term as a single token. So a parsed result might look like: > > +(title:hello title:world) +path:Resources\Live\1 > > Would anyone have any suggestions on how this could be done? I was > thinking maybe the QueryParser would have to be changed/extended to > accept a separator other than colon ":", something like "=" for example > to indicate this clause is not to be tokenised. Or perhaps this can all > be done using a single analyser?
Overriding QueryParser.getFieldQuery() might work for you. It is given the field and the query text so an analyzer can be chosen depending on the field. In case you don't use the latest cvs head, it may be worthwhile to have a look. Some of the getFieldQuery methods have been deprecated, but I don't know when. Regards, Paul. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]