Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0269f52
Adding changes for vectorIndex and vectorEmbeddingPolicy
aayush3011 Mar 22, 2024
29ad391
Adding some necessary comments
aayush3011 Mar 27, 2024
cd4d8cf
Adding test case
aayush3011 Mar 28, 2024
a2f6a83
updating enum values
aayush3011 Mar 28, 2024
c4bc283
Updating test case
aayush3011 Mar 28, 2024
af99d7b
Updating test case
aayush3011 Mar 29, 2024
6d8fc9b
Updating test case
aayush3011 Mar 29, 2024
2f7112d
updating changelog
aayush3011 Mar 29, 2024
158880f
Merge branch 'main' into users/akataria/vectorindexing
aayush3011 Mar 29, 2024
bb85dd3
Updating test case
aayush3011 Mar 29, 2024
a7185d7
Merge branch 'users/akataria/vectorindexing' of https://github.com/aa…
aayush3011 Mar 29, 2024
f4c4012
Merge branch 'Azure:main' into users/akataria/vectorindexing
aayush3011 Apr 2, 2024
72a4bcd
Resolving comments
aayush3011 Apr 2, 2024
dfb3575
Resolving comments
aayush3011 Apr 2, 2024
67f51cb
Fixing test case
aayush3011 Apr 2, 2024
730f8c2
Resolving comments
aayush3011 Apr 23, 2024
ad3ac89
Resolving Comments
aayush3011 Apr 27, 2024
940c6af
Merge branch 'main' into users/akataria/vectorindexing
aayush3011 Apr 27, 2024
3eb77ea
Fixing build issues
aayush3011 Apr 27, 2024
44f4e07
Merge branch 'main' into users/akataria/vectorindexing
aayush3011 Apr 29, 2024
460f681
Resolving comments
aayush3011 Apr 30, 2024
5579dd1
Resolving Comments
aayush3011 May 1, 2024
54a2ce3
Merge branch 'users/akataria/vectorindexing' of https://github.com/aa…
aayush3011 May 1, 2024
528a0eb
[Cosmos][VectorIndex]Adding changes for vectorIndex and vectorEmbeddi…
aayush3011 May 2, 2024
148cba5
[Cosmos][VectorSearch] Non Streaming Order By Query (#40085)
aayush3011 May 8, 2024
df7e838
[Cosmos][VectorSearch] Non Streaming Order By Query (#40096)
aayush3011 May 9, 2024
c8de52f
[Cosmos][VectorSearch] Non Streaming Order By Query (#40098)
aayush3011 May 9, 2024
425b78f
Merge branch 'Azure:main' into users/akataria/vectorindexing
aayush3011 May 10, 2024
55efb81
Resolving comments
aayush3011 May 10, 2024
9a3b003
Resolving comments
aayush3011 May 10, 2024
52917f9
[Cosmos][VectorSearch] Non Streaming Order By Query (#40115)
aayush3011 May 10, 2024
72a7145
Merge branch 'feature/vector_search' into users/akataria/vectorindexing
aayush3011 May 10, 2024
43f1d83
Merge branch 'Azure:main' into users/akataria/vectorindexing
aayush3011 May 12, 2024
fd13d87
Merge branch 'Azure:main' into users/akataria/vectorindexing
aayush3011 May 14, 2024
4055fe8
Fixing merge issues
aayush3011 May 14, 2024
62931db
Fixing merge issues
aayush3011 May 14, 2024
f7f7d08
Fixing build
aayush3011 May 15, 2024
bce71de
Fixing build
aayush3011 May 15, 2024
0a0a26a
Merge branch 'main' into users/akataria/vectorindexing
aayush3011 May 15, 2024
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
Prev Previous commit
Next Next commit
Fixing merge issues
  • Loading branch information
aayush3011 committed May 14, 2024
commit 4055fe8ab61d8e46d0526d16e06857e287f45df4
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,6 @@ public class Configs {
public static final String MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = "COSMOS.MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED";
private static final int DEFAULT_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1;

private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH";
private static final int DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = 50000;

private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED";

private static final boolean DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = true;

public static final int MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1;

public static final String TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS = "COSMOS.TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS";
Expand Down Expand Up @@ -491,14 +484,6 @@ public static int getMaxRetriesInLocalRegionWhenRemoteRegionPreferred() {
MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED);
}

public static int getMaxItemSizeForVectorSearch() {
return getJVMConfigAsInt(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH);
}

public static boolean getMaxItemSizeForVectorSearchEnabled() {
return getJVMConfigAsBoolean(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED);
}

public static Duration getMinRetryTimeInLocalRegionWhenRemoteRegionPreferred() {
return
Duration.ofMillis(Math.max(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public final class CosmosQueryRequestOptionsImpl extends CosmosQueryRequestOptio
private boolean queryPlanRetrievalDisallowed;
private boolean emptyPageDiagnosticsEnabled;
private String queryName;
private Integer maxItemSizeForVectorSearch;
private List<CosmosDiagnostics> cancelledRequestDiagnosticsTracker = new ArrayList<>();

/**
Expand Down Expand Up @@ -63,7 +62,6 @@ public CosmosQueryRequestOptionsImpl(CosmosQueryRequestOptionsImpl options) {
this.queryName = options.queryName;
this.feedRange = options.feedRange;
this.cancelledRequestDiagnosticsTracker = options.cancelledRequestDiagnosticsTracker;
this.maxItemSizeForVectorSearch = options.maxItemSizeForVectorSearch;
}

/**
Expand Down Expand Up @@ -198,26 +196,6 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) {
return this;
}

/**
* Gets the maximum item size to fetch during non-streaming order by queries.
*
* @return the max number of items for vector search.
*/
public Integer getMaxItemSizeForVectorSearch() {
return this.maxItemSizeForVectorSearch;
}

/**
* Sets the maximum item size to fetch during non-streaming order by queries.
*
* @param maxItemSizeForVectorSearch the max number of items for vector search.
* return the CosmosQueryRequestOptions.
*/
public CosmosQueryRequestOptionsImpl setMaxItemSizeForVectorSearch(Integer maxItemSizeForVectorSearch) {
this.maxItemSizeForVectorSearch = maxItemSizeForVectorSearch;
return this;
}

/**
* Gets the request continuation token.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ private static boolean canCacheQuery(QueryInfo queryInfo) {
&& !queryInfo.hasTop()
&& !queryInfo.hasOffset()
&& !queryInfo.hasDCount()
&& !queryInfo.hasOrderBy()
&& !queryInfo.hasNonStreamingOrderBy();
&& !queryInfo.hasOrderBy();
}

private static boolean isScopedToSinglePartition(CosmosQueryRequestOptions cosmosQueryRequestOptions) {
Expand Down Expand Up @@ -361,37 +360,6 @@ public static <T> Flux<? extends IDocumentQueryExecutionContext<T>> createSpecia

boolean getLazyFeedResponse = queryInfo.hasTop();

// We need to compute the optimal initial age size for non-streaming order-by queries
if (queryInfo.hasNonStreamingOrderBy() && Configs.getMaxItemSizeForVectorSearchEnabled()) {
// Validate the TOP or LIMIT for non-streaming order-by queries
if (!queryInfo.hasTop() && !queryInfo.hasLimit() && queryInfo.getTop() < 0 && queryInfo.getLimit() < 0) {
throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST,
"Executing a vector search query without TOP or LIMIT can consume a large number of RUs" +
"very fast and have long runtimes. Please ensure you are using one of the above two filters" +
"with you vector search query.");
}
// Validate the size of TOP or LIMIT against MaxItemSizeForVectorSearch
int maxLimit = Math.max(queryInfo.hasTop() ? queryInfo.getTop() : 0,
queryInfo.hasLimit() ? queryInfo.getLimit() : 0);
int maxItemSizeForVectorSearch = Math.max(Configs.getMaxItemSizeForVectorSearch(),
ModelBridgeInternal.getMaxItemSizeForVectorSearchFromQueryRequestOptions(cosmosQueryRequestOptions));
if (maxLimit > maxItemSizeForVectorSearch) {
throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST,
"Executing a vector search query with TOP or LIMIT larger than the maxItemSizeForVectorSearch " +
"is not allowed");
}
// Set initialPageSize based on the smallest of TOP or LIMIT
if (queryInfo.hasTop() || queryInfo.hasLimit()) {
int pageSizeWithTopOrLimit = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE,
queryInfo.hasLimit() ? queryInfo.getLimit() : Integer.MAX_VALUE);
if (initialPageSize > 0) {
initialPageSize = Math.min(pageSizeWithTopOrLimit, initialPageSize);
} else {
initialPageSize = pageSizeWithTopOrLimit;
}
}
}

// We need to compute the optimal initial page size for order-by queries
if (queryInfo.hasOrderBy()) {
int top;
Expand Down

This file was deleted.

This file was deleted.

Loading