You might want to look at Partial Updates
<https://solr.apache.org/guide/solr/latest/indexing-guide/partial-document-updates.html>
.
With this approach, when you reindex from the DB, you update in the index
the fields that come from the DB and keep the values of the other fields
unchanged. This is achieved by storing in the index the values of these
other fields (in addition to indexing them) so that Solr can retrieve them
then index them back with the update coming from the DB.

Ilan

On Thu, Nov 27, 2025 at 11:31 AM Yaşar Arabacı <[email protected]> wrote:

> Hi,
>
> I have some documents (around 80K, grows by ~1K each week) in mongodb
> that I import weekly into solr using a custom python script.  I want
> to add new fields to documents that don't exist in mongodb (like
> favorite, hidden, comments etc).
>
> I made a small test and it looks like when I re-import data from
> mongodb, my custom fields get deleted.
>
> I am planning to merge mongodb fields and my custom fields in python
> script before reindexing, but I was wondering if there is a
> better/recommended way.
>
> Best Regards,
>

Reply via email to