Skip to content

Commit 2743b94

Browse files
committed
restore playground
1 parent d17ff42 commit 2743b94

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

playground/javascript/node/search.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import {
2-
BrowseResponse,
3-
Rule,
4-
searchClient,
5-
SearchRulesResponse,
6-
SearchSynonymsResponse,
7-
} from '@algolia/client-search';
8-
import { ApiError, createIterablePromise } from '@algolia/client-common';
1+
import { searchClient } from '@algolia/client-search';
2+
import { ApiError } from '@algolia/client-common';
93
import dotenv from 'dotenv';
104

115
dotenv.config({ path: '../../.env' });
@@ -23,15 +17,9 @@ client.addAlgoliaAgent('Node playground', '0.0.1');
2317

2418
async function testSearch() {
2519
try {
26-
const records: Record<string, any> = [];
20+
const res = await client.search<{ name: string }>({ requests: [{ indexName: searchIndex, query: searchQuery }] });
2721

28-
await client.browseObjects({
29-
indexName: 'gatsbyjs',
30-
31-
aggregator: (response) => records.push(...response.hits),
32-
});
33-
34-
console.log(records, records.length);
22+
console.log(`[OK]`, res.results[0].hits![0].name);
3523
} catch (e: any) {
3624
// Instance of
3725
if (e instanceof ApiError) {

0 commit comments

Comments
 (0)