Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要搜索 lucene.net 文档中包含字母之间的空格。
例子
文件 1:54 658 1 22
文件 2:54658 122
文件3:5 4658122
查询:54658122
我需要返回包含示例中查询的所有文档是所有文档。
谢谢
在 Lucene 索引中存储数据时,存储已从源数据中删除空格的文档字段 - 并索引该字段。搜索时,去掉空格并在没有空格的字段上搜索。如果空格在输出中很重要,我建议您也将原始数据放在 Lucene 文档的单独字段中。这样,您可以在找到具有其他字段的文档后将其用于用户显示。