문제

How to tell solr to search or deal with multibyte numbers like ٦٩ , its just the number 69

in other words the user has input ٦٩ into the search box , the browser would convert it to :%D9%A6%D9%A9

solr return no result since it doesn't have the value :%D9%A6%D9%A9

how to deal with such of these query ???

solr config is the default config

도움이 되었습니까?

해결책

I think you need to convert them from these characters to the number using solr.MappingCharFilterFactory https://cwiki.apache.org/confluence/display/solr/CharFilterFactories

So basically you can have a file mapping-ArabicNumbersToASCII.txt and that contains:

"٠" => "0"
"١" => "1"
"٢" => "2"
"٣" => "3"
...

Then use the it as the analyzer like so:

<analyzer>
  <charFilter class="solr.MappingCharFilterFactory" 
    mapping="mapping-ArabicNumbersToASCII.txt"/>
  <tokenizer ...>
  [...]
</analyzer>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top