Skip to content

Commit

Permalink
fix: update types with correct boosts key
Browse files Browse the repository at this point in the history
  • Loading branch information
TattdCodeMonkey committed Apr 2, 2024
1 parent 1dfd2a1 commit 3524734
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 123 deletions.
4 changes: 2 additions & 2 deletions packages/enterprise-search-universal/src/app-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export interface SearchRequest {
body?: {
query: string
analytics?: {}
boost?: {}
boosts?: {}
facets?: {}
filters?: {}
group?: {}
Expand Down Expand Up @@ -138,7 +138,7 @@ export interface MultiSearchRequest {
queries: Array<{
query: string
analytics?: {}
boost?: {}
boosts?: {}
facets?: {}
filters?: {}
group?: {}
Expand Down
28 changes: 0 additions & 28 deletions packages/enterprise-search/src/api/app/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -879,20 +879,6 @@ export default class API {
}, options)
}

async searchEsSearch_v0 (this: That, params: T.SearchEsSearchV0Request, options?: TransportRequestOptions): Promise<T.SearchEsSearchV0Response> {
const {
engine_name,
body,
...querystring
} = params ?? {}
return await this.transport.request<T.SearchEsSearchV0Response>({
method: 'POST',
path: `/api/as/v0/engines/${engine_name}/elasticsearch/_search`,
querystring,
body: body
}, options)
}

async searchEsSearch (this: That, params: T.SearchEsSearchRequest, options?: TransportRequestOptions): Promise<T.SearchEsSearchResponse> {
const {
engine_name,
Expand Down Expand Up @@ -989,20 +975,6 @@ export default class API {
}, options)
}

async search_explain_v0 (this: That, params: T.SearchExplainV0Request, options?: TransportRequestOptions): Promise<T.SearchExplainV0Response> {
const {
engine_name,
body,
...querystring
} = params ?? {}
return await this.transport.request<T.SearchExplainV0Response>({
method: 'POST',
path: `/api/as/v0/engines/${engine_name}/search_explain`,
querystring,
body: body
}, options)
}

async search_explain (this: That, params: T.SearchExplainRequest, options?: TransportRequestOptions): Promise<T.SearchExplainResponse> {
const {
engine_name,
Expand Down
96 changes: 3 additions & 93 deletions packages/enterprise-search/src/api/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2086,40 +2086,6 @@ export interface AddMetaEngineSourceResponse {
}
}

export interface SearchEsSearchV0Request {
/**
* Name of the engine
*/
engine_name: string
/**
* Query parameters to be passed to Elasticsearch _search API
*/
es_search_query_params?: {
[k: string]: unknown
}
/**
* The search query associated with this request when recording search analytics
*/
'X-Enterprise-Search-Analytics'?: {
[k: string]: unknown
}
/**
* Analytics tags to be applied with this search request
*/
'X-Enterprise-Search-Analytics-Tags'?: {
[k: string]: unknown
}
/**
* The Elasticsearch token API
*/
Authorization: {
[k: string]: unknown
}
body?: {}
}

export type SearchEsSearchV0Response = Record<string, unknown>

export interface SearchEsSearchRequest {
/**
* Name of the engine
Expand Down Expand Up @@ -2263,7 +2229,7 @@ export interface SearchRequest {
body?: {
query: string
analytics?: {}
boost?: {}
boosts?: {}
facets?: {}
filters?: {}
group?: {}
Expand Down Expand Up @@ -2326,7 +2292,7 @@ export interface MultiSearchRequest {
queries: Array<{
query: string
analytics?: {}
boost?: {}
boosts?: {}
facets?: {}
filters?: {}
group?: {}
Expand Down Expand Up @@ -2381,62 +2347,6 @@ export type MultiSearchResponse = Array<{
results: Array<{}>
}>

export interface SearchExplainV0Request {
/**
* Name of the engine
*/
engine_name: string
body?: {
query: string
analytics?: {}
boost?: {}
facets?: {}
filters?: {}
group?: {}
page?: {
current?: number
size?: number
}
result_fields?: {}
search_fields?: {
[k: string]: {
weight?: number
}
}
sort?: Array<{
[k: string]:
| ('asc' | 'desc')
| {
center?:
| string
| Array<{
[k: string]: unknown
}>
order?: 'asc' | 'desc'
mode?: 'min' | 'max' | 'median' | 'avg'
}
}>
}
}

export interface SearchExplainV0Response {
meta: {
alerts: string[]
warnings: string[]
precision?: number
engine: {
name?: string
/**
* Engine type
*/
type?: 'meta' | 'default'
}
request_id?: string
}
query_string: string
query_body: {}
}

export interface SearchExplainRequest {
/**
* Name of the engine
Expand All @@ -2445,7 +2355,7 @@ export interface SearchExplainRequest {
body?: {
query: string
analytics?: {}
boost?: {}
boosts?: {}
facets?: {}
filters?: {}
group?: {}
Expand Down

0 comments on commit 3524734

Please sign in to comment.