lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Rowe <>
Subject Re: Lucene synonym for multi-words and query parsers
Date Wed, 12 Apr 2017 20:31:13 GMT
Hi Nicolas,

Classic QueryParser and SimpleQueryParser should work for you (see below).  Some work has
been done on StandardQueryParser (see <>),
but that work is not ready yet.  AFAIK nobody has worked on enabling multi-term analysis in

For Classic QueryParser, use setSplitOnWhitespace(false).  See <>.

For SimpleQueryParser, you can enable multi-term analysis by disabling only the whitespace
“operator” via the constructor taking the flags option <>,

new SimpleQueryParser(analyzer, Collections.singletonMap("field", 1f), ~SimpleQueryParser.WHITESPACE_OPERATOR);


> On Apr 12, 2017, at 11:49 AM, Nicolás Lichtmaier <> wrote:
> As far as I can see Lucene new support for multi word synonyms doesn't work with non-phrase
inputs. The analyzer can correctly create the graph, but it doesn't have the chance because
query parsers process word by word.
> Am I missing something?
> Here are some tests I've done... (synonyms are just "go to => open").<Captura de
pantalla de 2017-04-12 12-41-09.png>
> Thanks!
> Nicolás.-

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message