Skip to content

Commit

Permalink
Update Test Code
Browse files Browse the repository at this point in the history
  • Loading branch information
sarangan12 committed Jan 22, 2021
1 parent 69b13f7 commit 487b50f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function main() {
return;
}
const client = new SearchIndexClient(endpoint, new AzureKeyCredential(apiKey));
const index:SearchIndex = await client.getIndex("example-index");
const index: SearchIndex = await client.getIndex("example-index");

index.tokenizers?.push({
name: "example-tokenizer",
Expand All @@ -45,7 +45,7 @@ export async function main() {
index.analyzers?.push({
name: "example-analyzer",
odatatype: "#Microsoft.Azure.Search.CustomAnalyzer",
tokenizerName: "example-tokenizer",
tokenizer: "example-tokenizer",
charFilters: ["example-char-filter"],
tokenFilters: [KnownTokenFilterNames.Lowercase, "example-token-filter"]
});
Expand All @@ -60,7 +60,6 @@ export async function main() {
});

console.log(result.tokens);

}

main().catch((err) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import {
SearchIndexClient,
AzureKeyCredential,
SearchIndex
} from "@azure/search-documents";
import { SearchIndexClient, AzureKeyCredential, SearchIndex } from "@azure/search-documents";
import * as dotenv from "dotenv";
dotenv.config();

Expand All @@ -20,7 +16,7 @@ export async function main() {
}
const client = new SearchIndexClient(endpoint, new AzureKeyCredential(apiKey));
console.log(`Get Index example-index`);
const index:SearchIndex = await client.getIndex("example-index");
const index: SearchIndex = await client.getIndex("example-index");
console.log(`Name: ${index.name}`);
console.log(`Similarity Algorithm: ${index.similarity?.odatatype}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom
suggesters: [
{
name: "sg",
sourceFields: ["description", "hotelName"]
sourceFields: ["description", "hotelName"],
searchMode: "analyzingInfixMatching"
}
],
scoringProfiles: [
Expand Down

0 comments on commit 487b50f

Please sign in to comment.