Skip to content

[8.x] Improve SearchApplication definition (and related) (#3040) #3414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 4 additions & 23 deletions specification/search_application/_types/SearchApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,17 @@
* under the License.
*/

import { IndexName, Name } from '@_types/common'
import { Script } from '@_types/Scripting'
import { Name } from '@_types/common'
import { EpochTime, UnitMillis } from '@_types/Time'
import { SearchApplicationParameters } from './SearchApplicationParameters'

export class SearchApplication {
export class SearchApplication extends SearchApplicationParameters {
/**
* Search Application name.
* Search Application name
*/
name: Name
/**
* Indices that are part of the Search Application.
*/
indices: IndexName[]
/**
* Last time the Search Application was updated.
*/
updated_at_millis: EpochTime<UnitMillis>
/**
* Analytics collection associated to the Search Application.
*/
analytics_collection_name?: Name
/**
* Search template to use on search operations.
*/
template?: SearchApplicationTemplate
}

export class SearchApplicationTemplate {
/**
* The associated mustache template.
*/
script: Script
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { IndexName, Name } from '@_types/common'
import { SearchApplicationTemplate } from './SearchApplicationTemplate'

export class SearchApplicationParameters {
/**
* Indices that are part of the Search Application.
*/
indices: IndexName[]
/**
* Analytics collection associated to the Search Application.
*/
analytics_collection_name?: Name
/**
* Search template to use on search operations.
*/
template?: SearchApplicationTemplate
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { Script } from '@_types/Scripting'

export class SearchApplicationTemplate {
/**
* The associated mustache template.
*/
script: Script
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { SearchApplication } from '../_types/SearchApplication'
import { SearchApplication } from '@search_application/_types/SearchApplication'

export class Response {
body: SearchApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,12 @@
* under the License.
*/

import { IndexName, Name } from '@_types/common'
import { SearchApplication } from '@search_application/_types/SearchApplication'
import { long } from '@_types/Numeric'
import { EpochTime, UnitMillis } from '@_types/Time'

export class Response {
body: {
count: long
results: SearchApplicationListItem[]
results: SearchApplication[]
}
}

export class SearchApplicationListItem {
/**
* Search Application name
*/
name: Name
/**
* Indices that are part of the Search Application
*/
indices: IndexName[]
/**
* Last time the Search Application was updated
*/
updated_at_millis: EpochTime<UnitMillis>
/**
* Analytics collection associated to the Search Application
*/
analytics_collection_name?: Name
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import { RequestBase } from '@_types/Base'
import { Name } from '@_types/common'
import { SearchApplication } from '../_types/SearchApplication'
import { SearchApplicationParameters } from '../_types/SearchApplicationParameters'

/**
* Create or update a search application.
Expand All @@ -44,5 +44,5 @@ export interface Request extends RequestBase {
* Contains parameters for a search application.
*/
/** @codegen_name search_application */
body: SearchApplication
body: SearchApplicationParameters
}
Loading