You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by chalaulait 808 <bo...@gmail.com> on 2020/04/06 14:13:34 UTC

A question about underscore

I am using Solr4.0.13 to implement the search function of the document
management system.
I am currently having issues with search results when the search string
contains an underscore.
For example, if I search for the character string "AAA_001", the search
results will return results like "AAA" OR "001"

I checked the Solr manual below and found that some characters needed
escaping, but they didn't include underscores.

https://archive.apache.org/dist/lucene/solr/ref-guide/apache-solr-ref-guide-4.10.pdf

Is this event a specification?
Please let me know if any information is missing.
Thank you.

Re: A question about underscore

Posted by Erick Erickson <er...@gmail.com>.
I _strongly_ urge you to become acquainted with the Admin UI, particularly the “analysis” section. It’ll show you exactly what transformations each step in your analysis chain perform.

Without you providing the fieldType definition, all I can do is guess but my guess is that you have WordDelimiterFilterFactory in your analysis chain, which splits on underscores. If you change that definition, you’ll have to re-index from scratch.

Best,
Erick

> On Apr 6, 2020, at 10:13 AM, chalaulait 808 <bo...@gmail.com> wrote:
> 
> I am using Solr4.0.13 to implement the search function of the document
> management system.
> I am currently having issues with search results when the search string
> contains an underscore.
> For example, if I search for the character string "AAA_001", the search
> results will return results like "AAA" OR "001"
> 
> I checked the Solr manual below and found that some characters needed
> escaping, but they didn't include underscores.
> 
> https://archive.apache.org/dist/lucene/solr/ref-guide/apache-solr-ref-guide-4.10.pdf
> 
> Is this event a specification?
> Please let me know if any information is missing.
> Thank you.