paulirwin commented on issue #1165: URL: https://github.com/apache/lucenenet/issues/1165#issuecomment-3197536534
@Mohsens22 Thank you for your issue report. I'm pleased to report that there is good news: you can fix this issue without having to wait on a Lucene.NET release, because it is not a bug 😄 The issue occurs because your choice of analyzer, StandardAnalyzer, treats `/` as a delimiter that it can split on to consider each segment separate tokens. The reasoning why StandardAnalyzer does this is so that if you had "open/closed" in your text, you could successfully match on a search for just "open". This is a good analyzer to use on plain English text, but not for URLs. You probably want to be using a KeywordAnalyzer instead, which treats the entire URL as one token. If you switch your code to KeywordAnalyzer, you should find that the slash is preserved. If you need to use StandardAnalyzer (or other analyzers) on other fields besides `url_exact`, you can use a [PerFieldAnalyzerWrapper](https://lucenenet.apache.org/docs/4.8.0-beta00017/api/analysis-common/Lucene.Net.Analysis.Miscellaneous.PerFieldAnalyzerWrapper.html). Hope this helps! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
