@@ -26,7 +26,6 @@ public sealed class VectorStoreWriter<T> : IngestionChunkWriter<T>
2626 private readonly VectorStore _vectorStore ;
2727 private readonly int _dimensionCount ;
2828 private readonly VectorStoreWriterOptions _options ;
29- private readonly bool _keysAreStrings ;
3029
3130 private VectorStoreCollection < object , Dictionary < string , object ? > > ? _vectorStoreCollection ;
3231
@@ -43,12 +42,6 @@ public VectorStoreWriter(VectorStore vectorStore, int dimensionCount, VectorStor
4342 _vectorStore = Throw . IfNull ( vectorStore ) ;
4443 _dimensionCount = Throw . IfLessThanOrEqual ( dimensionCount , 0 ) ;
4544 _options = options ?? new VectorStoreWriterOptions ( ) ;
46-
47- // Not all vector store support string as the key type, examples:
48- // Qdrant: https://github.com/microsoft/semantic-kernel/blob/28ea2f4df872e8fd03ef0792ebc9e1989b4be0ee/dotnet/src/VectorData/Qdrant/QdrantCollection.cs#L104
49- // When https://github.com/microsoft/semantic-kernel/issues/13141 gets released,
50- // we need to remove this workaround.
51- _keysAreStrings = vectorStore . GetType ( ) . Name != "QdrantVectorStore" ;
5245 }
5346
5447 /// <summary>
@@ -85,7 +78,7 @@ public override async Task WriteAsync(IAsyncEnumerable<IngestionChunk<T>> chunks
8578 var key = Guid . NewGuid ( ) ;
8679 Dictionary < string , object ? > record = new ( )
8780 {
88- [ KeyName ] = _keysAreStrings ? key . ToString ( ) : key ,
81+ [ KeyName ] = key ,
8982 [ ContentName ] = chunk . Content ,
9083 [ EmbeddingName ] = chunk . Content ,
9184 [ ContextName ] = chunk . Context ,
@@ -129,7 +122,7 @@ private VectorStoreCollectionDefinition GetVectorStoreRecordDefinition(Ingestion
129122 {
130123 Properties =
131124 {
132- new VectorStoreKeyProperty ( KeyName , _keysAreStrings ? typeof ( string ) : typeof ( Guid ) ) ,
125+ new VectorStoreKeyProperty ( KeyName , typeof ( Guid ) ) ,
133126
134127 // By using T as the type here we allow the vector store
135128 // to handle the conversion from T to the actual vector type it supports.
0 commit comments