PhraseQuery can indeed be used to represent a multi-token synonym.
In fact, I mis-spoke before: MultiPhraseQuery can also represent a
multi-token synonym when the multiple tokens are all the same except in one
spot.
Mike McCandless
http://blog.mikemccandless.com
On Thu, Sep 20, 2018 at 2:32 PM
You might want to index the name field normally (as StringField, for
example), then index the age as a NumericDocValuesField, and then make a
BooleanQuery with two required clauses, one clause TermQuery on the name,
the other a NumericDocValuesField.newSlowExactQuery. Even though its name
is "slow