apache / solr-operator

Official Kubernetes operator for Apache Solr
https://solr.apache.org/operator
Apache License 2.0
243 stars 111 forks source link

Updating Solr Document Results Duplicate Versions #532

Closed OAsik closed 1 year ago

OAsik commented 1 year ago

I'm updating a SOLR doc via the below command:

'base Uri'/update?overwrite=true&commitWithin=2000&wt=json

The problem is SOLR duplicates the doc instead overwritting the old one. After the update, I have end up with two docs with same id field (id field is also defined as a uniqueKey), but different _version_ numbers.

Updated docs have two new fields that older versions do not have (as I have make additions to the schame.xml file recently).

I'm sharing necessary parts of my schema below:

<?xml version="1.0" encoding="UTF-8" ?> <schema name="My Project Solr 7.2.0 (stable version) Instance" version="1.6"> <field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="_version_" type="long" indexed="true" stored="true"/> <!-- other fields --> <uniqueKey>id</uniqueKey>

Why I end up with two docs with same unique key field after the update command?

mkhludnev commented 1 year ago

Couldn't they land onto separate shards somehow? You can check it with fl=[shard]

On Sat, Mar 11, 2023 at 8:30 PM Özgür @.***> wrote:

I'm updating a SOLR doc via the below command:

'base Uri'/update?overwrite=true&commitWithin=2000&wt=json

The problem is SOLR duplicates the doc instead overwritting the old one. After the update, I have end up with two docs with same id field (id field is also defined as a uniqueKey), but different version numbers.

Updated docs have two new fields that older versions do not have (as I have make additions to the schame.xml file recently).

I'm sharing necessary parts of my schema below:

<?xml version="1.0" encoding="UTF-8" ?> <schema name="My Project Solr 7.2.0 (stable version) Instance" version="1.6"> <field name="id" type="string" indexed="true" stored="true" required="true" />

id

Why I end up with two docs with same unique key field after the update command?

— Reply to this email directly, view it on GitHub https://github.com/apache/solr-operator/issues/532, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGFEYWQAL4F3TY76A2DJ3DW3SZBVANCNFSM6AAAAAAVXTD3TE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Sincerely yours Mikhail Khludnev https://t.me/MUST_SEARCH A caveat: Cyrillic!

HoustonPutman commented 1 year ago

I'd post this question to the solr users list, since this question is purely about Solr and not about interactions with Kubernetes.