Skip to content

Commit c69d9ac

Browse files
committed
fix
1 parent 3453cef commit c69d9ac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/indexes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { HttpRequests } from './http-requests'
4444
import { Task, TaskClient } from './task'
4545
import { EnqueuedTask } from './enqueued-task'
4646

47-
class Index<D = Record<string, any>> {
47+
class Index<T = Record<string, any>> {
4848
uid: string
4949
primaryKey: string | undefined
5050
createdAt: Date | undefined
@@ -78,11 +78,11 @@ class Index<D = Record<string, any>> {
7878
* @param {Partial<Request>} config? Additional request configuration options
7979
* @returns {Promise<SearchResponse<T>>} Promise containing the search response
8080
*/
81-
async search<T = D>(
81+
async search<D = T>(
8282
query?: string | null,
8383
options?: SearchParams,
8484
config?: Partial<Request>
85-
): Promise<SearchResponse<T>> {
85+
): Promise<SearchResponse<D>> {
8686
const url = `indexes/${this.uid}/search`
8787

8888
return await this.httpRequest.post(
@@ -103,11 +103,11 @@ class Index<D = Record<string, any>> {
103103
* @param {Partial<Request>} config? Additional request configuration options
104104
* @returns {Promise<SearchResponse<T>>} Promise containing the search response
105105
*/
106-
async searchGet<T = D>(
106+
async searchGet<D = T>(
107107
query?: string | null,
108108
options?: SearchParams,
109109
config?: Partial<Request>
110-
): Promise<SearchResponse<T>> {
110+
): Promise<SearchResponse<D>> {
111111
const url = `indexes/${this.uid}/search`
112112

113113
const parseFilter = (filter?: Filter): string | undefined => {

0 commit comments

Comments
 (0)