Hi again,

Thanks for everyone who replied.  The PerFieldAnalyzerWrapper was a good
suggestion, and one I had overlooked, but for our particular
requirements it wouldn't quite work so I went with overriding

You were right, Paul.  In 1.4.2 a whole heap of QueryParser changes were
made, mostly removing the analyzer parameter from methods.

In the end I built my changes on top of the NewMultiFieldQueryParser
which was shared here recently and works wonders -- thanks Bill Janssen
and sergiu gordea.  I added support for slops and boosts to build
together with the multi-fields array, and then overrode getFieldQuery to
check the queryText for a start char ("=" for example) and if found
remove it and switch to a non-tokenising analyser.

Then I found that because that analyser always returns a single token
(TermQuery) it would send through spaces into the final query string,
causing problems.  So also in getFieldQuery I check if it needs breaking
up and converting into a PhraseQuery.

Seems to work, just needs thorough testing.  If anyone would like a copy
I could post it up here.

Regards, --Leto
(excuse the disclaimer...)

> 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?


Information in this transmission is intended only for the person(s) to whom it 
is addressed and may contain privileged and/or confidential information. If you 
are not the intended recipient, any disclosure, copying or dissemination of the 
information is unauthorised and you should delete/destroy all copies and notify 
the sender. No liability is accepted for any unauthorised use of the 
information contained in this transmission.

This disclaimer has been automatically added.

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to