Skip to content

Commit c993015

Browse files
committed
restore playground
1 parent 671505b commit c993015

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

playground/javascript/node/search.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,17 @@ dotenv.config({ path: '../../.env' });
77
const appId = process.env.ALGOLIA_APPLICATION_ID || '**** APP_ID *****';
88
const apiKey = process.env.ALGOLIA_SEARCH_KEY || '**** SEARCH_API_KEY *****';
99

10-
const indexName = process.env.SEARCH_INDEX || 'test_index';
10+
const searchIndex = process.env.SEARCH_INDEX || 'test_index';
1111
const searchQuery = process.env.SEARCH_QUERY || 'test_query';
1212

1313
// Init client with appId and apiKey
1414
const client = searchClient(appId, apiKey);
1515

1616
client.addAlgoliaAgent('Node playground', '0.0.1');
1717

18-
type TObject = {
19-
name: string;
20-
};
21-
2218
async function testSearch() {
2319
try {
24-
const res = await client.search<TObject>({
25-
requests: [{ indexName, query: searchQuery }],
26-
});
27-
28-
await client.browse({ indexName });
29-
30-
await client.searchSingleIndex({ indexName, searchParams: {} });
20+
const res = await client.search<{ name: string }>({ requests: [{ indexName: searchIndex, query: searchQuery }] });
3121

3222
console.log(`[OK]`, res.results[0].hits![0].name);
3323
} catch (e: any) {

0 commit comments

Comments
 (0)