MemoryRecord mapping logic in AzureCognitiveSearchMemoryStore.getNearestMatchesAsync method can't be extended. Cognitive Search field names are hardcoded in AzureCognitiveSearchMemoryRecord.
I would suggest to provide an extensibility mechanism for custom cognitive search index field mapping while still preserving the MemoryRecord contract. An idea could be to add an overloaded getNearestMatchesAsync method which accepts a mapper function parameter like this: Function<SearchDocument,MemoryRecord> memoryRecordMapper. An example how you could implement it's here... and you can use it (+/-) like this
This can be useful in scenario where you don't have full control (different teams, different implementations) of both vector store indexing and vector similarity search processes (which is my use case ).
MemoryRecord mapping logic in AzureCognitiveSearchMemoryStore.getNearestMatchesAsync method can't be extended. Cognitive Search field names are hardcoded in AzureCognitiveSearchMemoryRecord.
I would suggest to provide an extensibility mechanism for custom cognitive search index field mapping while still preserving the MemoryRecord contract. An idea could be to add an overloaded getNearestMatchesAsync method which accepts a mapper function parameter like this: Function<SearchDocument,MemoryRecord> memoryRecordMapper. An example how you could implement it's here... and you can use it (+/-) like this
This can be useful in scenario where you don't have full control (different teams, different implementations) of both vector store indexing and vector similarity search processes (which is my use case ).