Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Bump Azure.Search.Documents from 11.5.0-beta.4 to 11.5.0-beta.5 in /dotnet #3106

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<PackageVersion Include="Azure.AI.OpenAI" Version="1.0.0-beta.8" />
<PackageVersion Include="Azure.Identity" Version="1.10.1" />
<PackageVersion Include="Azure.Search.Documents" Version="11.5.0-beta.4" />
<PackageVersion Include="Azure.Search.Documents" Version="11.5.0-beta.5" />
<PackageVersion Include="Microsoft.ApplicationInsights.WorkerService" Version="2.21.0" />
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="11.3.4" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="[1.1.0, )" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,16 @@ public async IAsyncEnumerable<MemoryRecord> GetBatchAsync(

var client = this.GetSearchClient(normalizedIndexName);

SearchQueryVector vectorQuery = new()
RawVectorQuery vectorQuery = new()
{
KNearestNeighborsCount = limit,
Fields = { AzureCognitiveSearchMemoryRecord.EmbeddingField },
Value = MemoryMarshal.TryGetArray(embedding, out var array) && array.Count == embedding.Length ? array.Array! : embedding.ToArray(),
Vector = MemoryMarshal.TryGetArray(embedding, out var array) && array.Count == embedding.Length ? array.Array! : embedding.ToArray(),
};

SearchOptions options = new()
{
Vectors = { vectorQuery }
VectorQueries = { vectorQuery }
};

Response<SearchResults<AzureCognitiveSearchMemoryRecord>>? searchResult = null;
Expand Down Expand Up @@ -275,7 +275,9 @@ private Task<Response<SearchIndex>> CreateIndexAsync(
throw new SKException("Invalid embedding size: the value must be greater than zero.");
}

var configName = "searchConfig";
const string ProfileName = "searchProfile";
const string AlgorithmName = "searchAlgorithm";

var newIndex = new SearchIndex(indexName)
{
Fields = new List<SearchField>
Expand All @@ -285,7 +287,7 @@ private Task<Response<SearchIndex>> CreateIndexAsync(
{
IsSearchable = true,
VectorSearchDimensions = embeddingSize,
VectorSearchConfiguration = configName
VectorSearchProfile = ProfileName
},
new SearchField(AzureCognitiveSearchMemoryRecord.TextField, SearchFieldDataType.String) { IsFilterable = true, IsFacetable = true },
new SimpleField(AzureCognitiveSearchMemoryRecord.DescriptionField, SearchFieldDataType.String) { IsFilterable = true, IsFacetable = true },
Expand All @@ -295,13 +297,14 @@ private Task<Response<SearchIndex>> CreateIndexAsync(
},
VectorSearch = new VectorSearch
{
AlgorithmConfigurations =
Algorithms =
{
new HnswVectorSearchAlgorithmConfiguration(configName)
new HnswVectorSearchAlgorithmConfiguration(AlgorithmName)
{
Parameters = new HnswParameters { Metric = VectorSearchAlgorithmMetric.Cosine }
}
}
},
Profiles = { new VectorSearchProfile(ProfileName, AlgorithmName) }
}
};

Expand Down
Loading