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

Move text from method parameter to options bag #9570

Merged
merged 1 commit into from
Jun 17, 2020
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
3 changes: 2 additions & 1 deletion sdk/search/search-documents/review/search-documents.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface AnalyzedTokenInfo {
export interface AnalyzeRequest {
analyzerName?: string;
charFilters?: string[];
text: string;
tokenFilters?: string[];
tokenizerName?: string;
}
Expand Down Expand Up @@ -1047,7 +1048,7 @@ export interface SearchIndex {
// @public
export class SearchIndexClient {
constructor(endpoint: string, credential: KeyCredential, options?: SearchIndexClientOptions);
analyzeText(indexName: string, text: string, options: AnalyzeTextOptions): Promise<AnalyzeResult>;
analyzeText(indexName: string, options: AnalyzeTextOptions): Promise<AnalyzeResult>;
readonly apiVersion: string;
createIndex(index: SearchIndex, options?: CreateIndexOptions): Promise<SearchIndex>;
createOrUpdateIndex(index: SearchIndex, options?: CreateOrUpdateIndexOptions): Promise<SearchIndex>;
Expand Down
7 changes: 1 addition & 6 deletions sdk/search/search-documents/src/searchIndexClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,7 @@ export class SearchIndexClient {
* @param text The text to break into tokens.
* @param options Additional arguments
*/
public async analyzeText(
indexName: string,
text: string,
options: AnalyzeTextOptions
): Promise<AnalyzeResult> {
public async analyzeText(indexName: string, options: AnalyzeTextOptions): Promise<AnalyzeResult> {
const { operationOptions, restOptions } = utils.extractOperationOptions(options);

const { span, updatedOptions } = createSpan("SearchIndexClient-analyzeText", operationOptions);
Expand All @@ -581,7 +577,6 @@ export class SearchIndexClient {
indexName,
{
...restOptions,
text,
analyzer: restOptions.analyzerName,
tokenizer: restOptions.tokenizerName
},
Expand Down
4 changes: 4 additions & 0 deletions sdk/search/search-documents/src/serviceModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ export interface DeleteDataSourceConnectionOptions extends OperationOptions {
* Specifies some text and analysis components used to break that text into tokens.
*/
export interface AnalyzeRequest {
/**
* The text to break into tokens.
*/
text: string;
/**
* The name of the analyzer to use to break the given text. If this parameter is not specified,
* you must specify a tokenizer instead. The tokenizer and analyzer parameters are mutually
Expand Down