在Lucene5.x和2.x之间,StandardAnalyzer的默认行为是不同的,例如使用如下代码的that's H&M:
StandardAnalyzer analyzer = new StandardAnalyzer();
analyzer.tokenStream("text", new StringReader(chunkText));在lucene 2.x中,它标记为:
那个,H&M
在lucene 5.x中,它标记为:
那是,h,m
有没有办法使lucene 5.x对齐lucene 2.x的结果?
发布于 2018-02-06 07:36:02
回到Lucene 3中,他们更改了StandardAnalyzer以实现UAX #29中指定的Unicode文本分段。如果您希望使用2.X中的旧的、更简单的分词算法,请使用ClassicAnalyzer。
https://stackoverflow.com/questions/48637511
复制相似问题