Exemplo n.º 1
0
  @Override
  public Query parseQuery(String query, Locale locale) throws ParseException {
    FullTextSession fullTextSession = getFullTextSession();

    MultiFieldQueryParser parser =
        new MultiFieldQueryParser(
            Version.LUCENE_36,
            new String[] {"text", "title"},
            fullTextSession.getSearchFactory().getAnalyzer("content"));

    if (locale != null) {
      parser.setLocale(locale);
    }

    return parser.parse(query);
  }