是否可以更改Solr中架构中指定的分析器而无需从原始源重新索引? [英] Is it possible to change the analyzer specified in the schema in Solr without reindexing from the original source?

查看:97
本文介绍了是否可以更改Solr中架构中指定的分析器而无需从原始源重新索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Solr中,如果我们在架构中有一个带有stored =true的字段,并且我们更改了与该字段关联的分析器,是否可以仅更新此字段而无需重新索引所有文档?这可以使用新分析仪使用字段的存储值而不返回原始数据源吗?

In Solr, if we have a field in the schema with stored="true", and we change the analyzer associated with that field, is it possible to update just this field without reindexing all the documents? Could this be done using the "stored" values of the field with the new analyzer without going back to the original data source?

推荐答案

盖伊,我优化了您的代码。

Guy, I optimized your code.

    ...
    while (iter.hasNext()) {
        ...
        //server.deleteById(id) ;
        //server.commit() ;

        Collection<SolrInputDocument> docs = new ArrayList<SolrInputDocument>();
        docs.add(inputdoc) ;
        server.add(docs) ;
        // server.commit() ;
    }
    server.commit() ;

这篇关于是否可以更改Solr中架构中指定的分析器而无需从原始源重新索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆