gpt4 book ai didi

java - Apache Solr 6.6.1 乌尔都语语言的数字映射

转载 作者:太空宇宙 更新时间:2023-11-04 10:40:43 25 4
gpt4 key购买 nike

我已配置 Apache Solr 6.6.2 以便稍后索引和搜索文档。我面临一些问题。如果文档中有一个数字,如 1234,我希望它应该映射(复制)到相应的乌尔都语数字,如 1234。如果用户输入 1234 或 1234,最终将有助于检索文档。Solr 中是否有任何内置解决方案或者我如何进入此功能?

最佳答案

如果您使用 Java/SolrJ 客户端进行索引...

将 junidecode 依赖项添加到您的项目

对于 gradle

compile group: 'junidecode', name: 'junidecode', version: '0.1.1'

对于行家:

<dependency>
<groupId>junidecode</groupId>
<artifactId>junidecode</artifactId>
<version>0.1.1</version>
</dependency>

索引时...索引附加字段...

import net.sf.junidecode.Junidecode;
String converted = Junidecode.unidecode("۱۲۳۴")
// converted == 1234

关于java - Apache Solr 6.6.1 乌尔都语语言的数字映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49004784/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com