-2

The only ways I can see to create a PhraseQuery are:

  • QueryParser.parse, adding " to the start and end of the string (being careful to escape any special characters).
  • PhraseQuery.add which needs the Terms to have been pre-analyzed.

Is there a way to construct a PhraseQuery by just applying the Analyzer to a String that is to be understood literally, and hasn't been manipulated as a query?

4

1 回答 1

-1

Doesn't seem to be possible (plus some junk to allow this to be posted).

于 2013-08-19T10:51:52.010 回答