Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change the analyzer specified in the schema in Solr without reindexing from the original source?

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?

like image 469
Juampa Avatar asked Nov 15 '22 06:11

Juampa


1 Answers

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() ;
like image 162
aaashun Avatar answered Dec 21 '22 18:12

aaashun