Skip to content

Commit 2be89ce

Browse files
Move schema types to shared
We use the Schema types in Workplace Search as well, so moving these to shared. Also, we have a component called IndexingStatus so reverting to the prefixed IIndexingStatus interface name
1 parent ae9df69 commit 2be89ce

4 files changed

Lines changed: 26 additions & 37 deletions

File tree

x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { kea, MakeLogicType } from 'kea';
88

99
import { HttpLogic } from '../../../shared/http';
1010

11-
import { IndexingStatus } from '../schema/types';
11+
import { IIndexingStatus } from '../../../shared/types';
1212
import { EngineDetails } from './types';
1313

1414
interface EngineValues {
@@ -25,7 +25,7 @@ interface EngineValues {
2525
interface EngineActions {
2626
setEngineData(engine: EngineDetails): { engine: EngineDetails };
2727
setEngineName(engineName: string): { engineName: string };
28-
setIndexingStatus(activeReindexJob: IndexingStatus): { activeReindexJob: IndexingStatus };
28+
setIndexingStatus(activeReindexJob: IIndexingStatus): { activeReindexJob: IIndexingStatus };
2929
setEngineNotFound(notFound: boolean): { notFound: boolean };
3030
clearEngine(): void;
3131
initializeEngine(): void;

x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { ApiToken } from '../credentials/types';
8-
import { Schema, SchemaConflicts, IndexingStatus } from '../schema/types';
8+
import { Schema, SchemaConflicts, IndexingStatus } from '../../../shared/types';
99

1010
export interface Engine {
1111
name: string;

x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/types.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

x-pack/plugins/enterprise_search/public/applications/shared/types.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
export type SchemaTypes = 'text' | 'number' | 'geolocation' | 'date';
8+
9+
export interface Schema {
10+
[key: string]: SchemaTypes;
11+
}
12+
13+
// this is a mapping of schema field types ("string", "number", "geolocation", "date") to the names
14+
// of source engines which utilize that type
15+
export type SchemaConflictFieldTypes = {
16+
[key in SchemaTypes]: string[];
17+
};
18+
19+
export interface SchemaConflict {
20+
fieldTypes: SchemaConflictFieldTypes;
21+
resolution?: string;
22+
}
23+
24+
// For now these values are ISchemaConflictFieldTypes, but in the near future will be ISchemaConflict
25+
// once we implement schema conflict resolution
26+
export interface SchemaConflicts {
27+
[key: string]: SchemaConflictFieldTypes;
28+
}
29+
730
export interface IIndexingStatus {
831
percentageComplete: number;
932
numDocumentsWithErrors: number;

0 commit comments

Comments
 (0)