1

luceneのキーワードアナライザーがうまく使えず、

    String term = "new york";
    // id and location are the fields in which i want to search the "term"
    MultiFieldQueryParser queryParser = new MultiFieldQueryParser(
                                       Version.LUCENE_30,
                                       {"id", "location"},
                                       new KeywordAnalyzer());
    Query query = queryParser.parse(term);
    System.out.println(query.toString());

結果: (id:new location:new) (id:york location:york)

期待される結果: (id:new york location:new york) (id:new york location:new york)

私がここで間違っていることを特定するのを手伝ってください??

4

1 に答える 1