mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 11:56:01 +00:00
Minor: Add name field in the advanced search fields list (#18399)
* Add name field in the advanced search fields list * Update the search index for autocomplete for name DisplayName * removed unnecessary array for searchIndex
This commit is contained in:
parent
4083838056
commit
4d1ebb31c1
@ -40,6 +40,7 @@ export enum EntityFields {
|
||||
ENTITY_TYPE = 'entityType',
|
||||
TABLE_TYPE = 'tableType',
|
||||
DISPLAY_NAME_KEYWORD = 'displayName.keyword',
|
||||
NAME_KEYWORD = 'name.keyword',
|
||||
GLOSSARY = 'glossary.name.keyword',
|
||||
CLASSIFICATION = 'classification.name.keyword',
|
||||
DOMAIN = 'domain.displayName.keyword',
|
||||
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2024 Collate.
|
||||
* Licensed 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 { EntityFields } from '../enums/AdvancedSearch.enum';
|
||||
import { AdvancedSearchClassBase } from './AdvancedSearchClassBase';
|
||||
|
||||
describe('AdvancedSearchClassBase', () => {
|
||||
let advancedSearchClassBase: AdvancedSearchClassBase;
|
||||
|
||||
beforeEach(() => {
|
||||
advancedSearchClassBase = new AdvancedSearchClassBase();
|
||||
});
|
||||
|
||||
it('getCommonConfig function should return expected fields', () => {
|
||||
const result = advancedSearchClassBase.getCommonConfig({});
|
||||
|
||||
expect(Object.keys(result)).toEqual([
|
||||
EntityFields.DISPLAY_NAME_KEYWORD,
|
||||
EntityFields.NAME_KEYWORD,
|
||||
'deleted',
|
||||
EntityFields.OWNERS,
|
||||
EntityFields.DOMAIN,
|
||||
'serviceType',
|
||||
EntityFields.TAG,
|
||||
EntityFields.TIER,
|
||||
'extension',
|
||||
'descriptionStatus',
|
||||
]);
|
||||
});
|
||||
});
|
@ -451,7 +451,7 @@ class AdvancedSearchClassBase {
|
||||
mainWidgetProps: this.mainWidgetProps,
|
||||
fieldSettings: {
|
||||
asyncFetch: this.autocomplete({
|
||||
searchIndex: entitySearchIndex ?? [SearchIndex.DATA_ASSET],
|
||||
searchIndex: SearchIndex.DATA_ASSET,
|
||||
entityField: EntityFields.DISPLAY_NAME_KEYWORD,
|
||||
}),
|
||||
useAsyncSearch: true,
|
||||
@ -466,6 +466,27 @@ class AdvancedSearchClassBase {
|
||||
'regexp',
|
||||
],
|
||||
},
|
||||
[EntityFields.NAME_KEYWORD]: {
|
||||
label: t('label.name'),
|
||||
type: 'select',
|
||||
mainWidgetProps: this.mainWidgetProps,
|
||||
fieldSettings: {
|
||||
asyncFetch: this.autocomplete({
|
||||
searchIndex: SearchIndex.DATA_ASSET,
|
||||
entityField: EntityFields.NAME_KEYWORD,
|
||||
}),
|
||||
useAsyncSearch: true,
|
||||
},
|
||||
operators: [
|
||||
'select_equals',
|
||||
'select_not_equals',
|
||||
'select_any_in',
|
||||
'select_not_any_in',
|
||||
'like',
|
||||
'not_like',
|
||||
'regexp',
|
||||
],
|
||||
},
|
||||
|
||||
deleted: {
|
||||
label: t('label.deleted'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user