最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Lucene.NET StandardAnalyzer Not Matching Tokens for Wildcard Queries - Stack Overflow

programmeradmin2浏览0评论

Question: I am working on a search functionality using Lucene.NET with the StandardAnalyzer, and I noticed an issue with wildcard queries not matching expected results.

Issue: My indexed field contains values like: 24-PC-QMR-NB-3

Since StandardAnalyzer tokenizes the text by splitting on hyphens (-), the stored tokens become:

["24", "pc", "qmr", "nb", "3"] When I run a normal search query like 24-PC-QMR-NB-3, Lucene correctly finds the document.

However, when using a wildcard query like 24-PC-QMR-NB-3*, it does not return any results.

Question: Why does StandardAnalyzer prevent wildcard queries from matching tokenized fields?

How can I modify my indexing or querying approach to allow wildcard searches on fields containing spaces or special characters?

发布评论

评论列表(0)

  1. 暂无评论