Skip to content

Commit

Permalink
Response to PR Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sarangan12 committed Jan 6, 2021
1 parent 904d85e commit f83a3fc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions sdk/search/search-documents/review/search-documents.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,10 @@ export interface IndexingSchedule {
}

// @public
export type IndexIterator = PagedAsyncIterableIterator<SearchIndex, SearchIndex[], Record<string, unknown>>;
export type IndexIterator = PagedAsyncIterableIterator<SearchIndex, SearchIndex[], {}>;

// @public
export type IndexNameIterator = PagedAsyncIterableIterator<string, string[], Record<string, unknown>>;
export type IndexNameIterator = PagedAsyncIterableIterator<string, string[], {}>;

// @public
export interface InputFieldMappingEntry {
Expand Down
2 changes: 1 addition & 1 deletion sdk/search/search-documents/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import { createClientLogger } from "@azure/logger";

/**
* The \@azure/logger configuration for this package.
* The `@azure/logger` configuration for this package.
*/
export const logger = createClientLogger("search");
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
SearchIndexingBufferedSenderMergeDocumentsOptions,
SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions,
SearchIndexingBufferedSenderDeleteDocumentsOptions,
SearchIndexingBufferedSenderFlushDocumentsOptions
SearchIndexingBufferedSenderFlushDocumentsOptions,
IndexDocumentsOptions
} from "./indexModels";
import { IndexDocumentsResult } from "./generated/data/models";
import { RestError, OperationOptions } from "@azure/core-http";
Expand All @@ -19,7 +20,13 @@ import { CanonicalCode } from "@opentelemetry/api";
import { SearchIndexingBufferedSender } from "./searchIndexingBufferedSender";
import { delay } from "@azure/core-http";
import { getRandomIntegerInclusive } from "./serviceUtils";
import { SearchClient } from "./searchClient";

interface IndexDocumentsClient<T> {
indexDocuments(
batch: IndexDocumentsBatch<T>,
options: IndexDocumentsOptions
): Promise<IndexDocumentsResult>;
}

/**
* Default Batch Size
Expand Down Expand Up @@ -50,7 +57,7 @@ class SearchIndexingBufferedSenderImpl<T> implements SearchIndexingBufferedSende
/**
* Search Client used to call the underlying IndexBatch operations.
*/
private client: SearchClient<T>;
private client: IndexDocumentsClient<T>;
/**
* Indicates if autoFlush is enabled.
*/
Expand Down Expand Up @@ -95,8 +102,7 @@ class SearchIndexingBufferedSenderImpl<T> implements SearchIndexingBufferedSende
* @param options - Options to modify auto flush.
*
*/
// eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
constructor(client: SearchClient<T>, options: SearchIndexingBufferedSenderOptions = {}) {
constructor(client: IndexDocumentsClient<T>, options: SearchIndexingBufferedSenderOptions = {}) {
this.client = client;
// General Configuration properties
this.autoFlush = options.autoFlush ?? false;
Expand Down Expand Up @@ -411,9 +417,8 @@ class SearchIndexingBufferedSenderImpl<T> implements SearchIndexingBufferedSende
* @param options - Options to modify auto flush.
*/
export function createSearchIndexingBufferedSender<T>(
// eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
searchClient: SearchClient<T>,
indexDocumentsClient: IndexDocumentsClient<T>,
options: SearchIndexingBufferedSenderOptions = {}
): SearchIndexingBufferedSender<T> {
return new SearchIndexingBufferedSenderImpl(searchClient, options);
return new SearchIndexingBufferedSenderImpl(indexDocumentsClient, options);
}
3 changes: 2 additions & 1 deletion sdk/search/search-documents/src/serialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export function deserialize<OutputT>(obj: unknown): OutputT {
}

function walk(start: unknown, mapper: (val: any) => any): any {
const seenMarker = new WeakMap<Record<string, unknown>, boolean>();
// eslint-disable-next-line @typescript-eslint/ban-types
const seenMarker = new WeakMap<object, boolean>();
const result = { value: undefined };
const queue: { value: any; parent: any; key: string }[] = [
{ value: start, parent: result, key: "value" }
Expand Down
18 changes: 6 additions & 12 deletions sdk/search/search-documents/src/serviceModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export interface PatternAnalyzer {
lowerCaseTerms?: boolean;
/**
* A regular expression pattern to match token separators. Default is an expression that matches
* one or more whitespace characters. Default value: '\\W+'.
* one or more whitespace characters. Default value: `\W+`.
*/
pattern?: string;
/**
Expand Down Expand Up @@ -479,7 +479,7 @@ export interface PatternTokenizer {
name: string;
/**
* A regular expression pattern to match token separators. Default is an expression that matches
* one or more whitespace characters. Default value: '\\W+'.
* one or more whitespace characters. Default value: `\W+`.
*/
pattern?: string;
/**
Expand Down Expand Up @@ -862,22 +862,16 @@ export interface SynonymMap {
* as needed during iteration. Use .byPage() to make one request to the server
* per iteration.
*/
export type IndexIterator = PagedAsyncIterableIterator<
SearchIndex,
SearchIndex[],
Record<string, unknown>
>;
// eslint-disable-next-line @typescript-eslint/ban-types
export type IndexIterator = PagedAsyncIterableIterator<SearchIndex, SearchIndex[], {}>;

/**
* An iterator for listing the indexes that exist in the Search service. Will make requests
* as needed during iteration. Use .byPage() to make one request to the server
* per iteration.
*/
export type IndexNameIterator = PagedAsyncIterableIterator<
string,
string[],
Record<string, unknown>
>;
// eslint-disable-next-line @typescript-eslint/ban-types
export type IndexNameIterator = PagedAsyncIterableIterator<string, string[], {}>;

/**
* Represents a search index definition, which describes the fields and search behavior of an
Expand Down

0 comments on commit f83a3fc

Please sign in to comment.