Adding a multi-valued string field to a Lucene Document, do commas matter?

后端 未结 2 1053
既然无缘
既然无缘 2021-02-15 16:16

I\'m building a Lucene Index and adding Documents.

I have a field that is multi-valued, for this example I\'ll use Categories.

An Item can have many categories,

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-15 16:52

    If you use the StandardAnalyzer it is ok to have commas or spaces. But if you have another Analyzer, it depends.

    Another way: You can have multiple times the same field with another category in it. Then I would recommend to use KeywordAnalyzer or let it be untokenized to have exact match of your category name.

提交回复
热议问题