# Codec Error with KNN

**URL:** <https://forum.opensearch.org/t/codec-error-with-knn/16358>\
**Category:** k-NN\
**Created:** [October 20, 2023, 6:30am UTC](https://forum.opensearch.org/t/codec-error-with-knn/16358 "2023-10-20T06:30:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asfoorial](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asfoorial](https://forum.opensearch.org/u/asfoorial)\
**Post date:** [October 20, 2023, 6:30am UTC](https://forum.opensearch.org/t/codec-error-with-knn/16358/1 "2023-10-20T06:30:53Z")

</div>

OpenSearch 2.11.0

Hi all,

How can I change the compression codec with kNN indices? I am getting the below error.

PUT knn\_index  
{  
“settings”: {  
“index”: {  
“replication”: {  
“type”: “DOCUMENT”  
},  
“codec”: “zstd”,  
“number\_of\_shards”: “1”,  
“knn”: “true”  
}  
}  
}

{  
“error”: {  
“root\_cause”: [  
{  
“type”: “illegal\_state\_exception”,  
“reason”: “existing codec service factory already overridden in: org.opensearch.knn.plugin.KNNPlugin attempting to override again by: org.opensearch.index.codec.customcodecs.CustomCodecPlugin”  
}  
],  
“type”: “illegal\_state\_exception”,  
“reason”: “existing codec service factory already overridden in: org.opensearch.knn.plugin.KNNPlugin attempting to override again by: org.opensearch.index.codec.customcodecs.CustomCodecPlugin”  
},  
“status”: 500  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [December 19, 2023, 6:30am UTC](https://forum.opensearch.org/t/codec-error-with-knn/16358/2 "2023-12-19T06:30:54Z")

</div>

Closed on December 19, 2023, 6:30am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
