Repository navigation
.Net MEVD: Filter-only search API (without vector similarity) - #11112
Adam Sitnik (adamsitnik) merged 24 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
…o queryAsync # Conflicts: # dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreDbClient.cs # dotnet/src/Connectors/Connectors.Memory.Postgres/SqlBuilder.cs # dotnet/src/Connectors/Connectors.Postgres.UnitTests/PostgresVectorStoreCollectionSqlBuilderTests.cs # dotnet/src/VectorDataIntegrationTests/AzureAISearchIntegrationTests/Support/AzureAISearchTestStore.cs
…o queryAsync # Conflicts: # dotnet/src/Connectors/VectorData/VectorStorage/LoggingVectorStoreRecordCollection.cs
…o queryAsync # Conflicts: # dotnet/samples/Concepts/Memory/VectorStoreEmbeddingGeneration/TextEmbeddingVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.AzureAISearch/AzureAISearchVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.MongoDB/MongoDBVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.Qdrant/QdrantVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.Weaviate/WeaviateVectorStoreRecordCollection.cs
Shay Rojansky (roji)
left a comment
There was a problem hiding this comment.
Awesome to see this, am really happy we'll have this capability!
| { | ||
| IsFilterable = dataProperty.IsFilterable, | ||
| // Sometimes the users ask to also OrderBy given filterable property, so we make it sortable. | ||
| IsSortable = dataProperty.IsFilterable && !fieldType.IsCollection |
There was a problem hiding this comment.
Yeah, I think this is one of the reasons we thought about renaming IsFilterable to IsIndexable indeed... In the future, we can have an Azure AI-specific IsSortable flag too.
| public VectorStoreRecordPropertyModel GetDataOrKeyProperty<TRecord>(Expression<Func<TRecord, object?>> expression) | ||
| => this.GetMatchingProperty<TRecord, VectorStoreRecordPropertyModel>(expression, data: true); | ||
|
|
||
| private TProperty GetMatchingProperty<TRecord, TProperty>(Expression<Func<TRecord, object?>> expression, bool data) |
There was a problem hiding this comment.
Just noting that this parameter is mainly there because of VectorStoreGenericDataModel, which has different dictionaries for data/vectors; that's going away with the transition to Dictionary<string, object?> tracked by #10802 (PR should be out this weekend).
In other words, I think this is super temporary and will be gone soon (so should be OK to merge as-is for now). We'd also rename GetDataOrKeyProperty to something like BindProperty (I'm already thinking about this also in relation to the filter translators...).
| foreach (var property in model.Properties) | ||
| { | ||
| if (options.IncludeVectors || property is not VectorStoreRecordVectorPropertyModel) | ||
| { | ||
| query.AppendFormat("\"{0}\",", property.StorageName); | ||
| } | ||
| } |
There was a problem hiding this comment.
Yeah, we should definitely do some passes to consolidate/refactor.
…o queryAsync # Conflicts: # dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBMongoDB/AzureCosmosDBMongoDBVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.InMemory/InMemoryVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.Pinecone/PineconeVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreDbClient.cs # dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.Redis/RedisHashSetVectorStoreRecordCollection.cs # dotnet/src/Connectors/Connectors.Memory.Redis/RedisJsonVectorStoreRecordCollection.cs # dotnet/src/Connectors/VectorData.Abstractions/CompatibilitySuppressions.xml
Shay Rojansky (roji)
left a comment
There was a problem hiding this comment.
OK, there seem to be a few more unresolved comments, but nothing that looks blocking - LGTM. Thanks Adam Sitnik (@adamsitnik)!
…o queryAsync # Conflicts: # dotnet/src/Connectors/Connectors.Memory.AzureAISearch/AzureAISearchVectorStoreRecordCollection.cs
- rename FilterOptions to GetFilteredRecordOptions - rename Sort to OrderBy - remove the limitation to select Key as the Redis ordeby field
Implemented with tests for:
fixes #10295