mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-25 08:58:26 +00:00
fix(Business Glossary): updated glossary term search strategy (#2973)
This commit is contained in:
parent
1fbc80bd39
commit
94b35fe8a0
@ -31,7 +31,7 @@ public class GlossaryTermSnapshotMapper implements ModelMapper<GlossaryTermSnaps
|
||||
result.setUrn(glossaryTerm.getUrn().toString());
|
||||
result.setType(EntityType.GLOSSARY_TERM);
|
||||
result.setName(GlossaryTermUtils.getGlossaryTermName(glossaryTerm.getUrn().getNameEntity()));
|
||||
|
||||
result.setHierarchicalName(glossaryTerm.getUrn().getNameEntity());
|
||||
ModelUtils.getAspectsFromSnapshot(glossaryTerm).forEach(aspect -> {
|
||||
if (aspect instanceof GlossaryTermInfo) {
|
||||
result.setGlossaryTermInfo(GlossaryTermInfoMapper.map(GlossaryTermInfo.class.cast(aspect)));
|
||||
|
||||
@ -384,6 +384,11 @@ type GlossaryTerm implements Entity {
|
||||
"""
|
||||
name: String!
|
||||
|
||||
"""
|
||||
hierarchicalName of glossary term
|
||||
"""
|
||||
hierarchicalName: String!
|
||||
|
||||
"""
|
||||
Details of the Glossary Term
|
||||
"""
|
||||
|
||||
@ -301,6 +301,7 @@ export const dataset3 = {
|
||||
type: EntityType.GlossaryTerm,
|
||||
urn: 'urn:li:glossaryTerm:sample-glossary-term',
|
||||
name: 'sample-glossary-term',
|
||||
hierarchicalName: 'example.sample-glossary-term',
|
||||
glossaryTermInfo: {
|
||||
definition: 'sample definition',
|
||||
termSource: 'sample term source',
|
||||
@ -529,6 +530,7 @@ const glossaryTerm1 = {
|
||||
urn: 'urn:li:glossaryTerm:1',
|
||||
type: EntityType.GlossaryTerm,
|
||||
name: 'Another glossary term',
|
||||
hierarchicalName: 'example.AnotherGlossaryTerm',
|
||||
ownership: {
|
||||
owners: [
|
||||
{
|
||||
|
||||
@ -122,6 +122,7 @@ export const sampleSchemaWithTags: Schema = {
|
||||
type: EntityType.GlossaryTerm,
|
||||
urn: 'urn:li:glossaryTerm:sample-glossary-term',
|
||||
name: 'sample-glossary-term',
|
||||
hierarchicalName: 'example.sample-glossary-term',
|
||||
glossaryTermInfo: {
|
||||
definition: 'sample definition',
|
||||
termSource: 'sample term source',
|
||||
|
||||
@ -28,10 +28,10 @@ export default function GlossaryTermProfile() {
|
||||
const searchTypes = entityRegistry.getSearchEntityTypes();
|
||||
searchTypes.splice(searchTypes.indexOf(EntityType.GlossaryTerm), 1);
|
||||
|
||||
const glossaryTermName = data?.glossaryTerm?.name;
|
||||
const glossaryTermHierarchicalName = data?.glossaryTerm?.hierarchicalName;
|
||||
const entitySearchResult = useGetEntitySearchResults(
|
||||
{
|
||||
query: `${glossaryTermName}`,
|
||||
query: `glossaryTerms:"${glossaryTermHierarchicalName}"`,
|
||||
},
|
||||
searchTypes,
|
||||
);
|
||||
|
||||
@ -3,6 +3,7 @@ query getGlossaryTerm($urn: String!) {
|
||||
urn
|
||||
type
|
||||
name
|
||||
hierarchicalName
|
||||
ownership {
|
||||
...ownershipFields
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ record GlossaryTermAssociation {
|
||||
*/
|
||||
@Searchable = {
|
||||
"fieldName": "glossaryTerms",
|
||||
"fieldType": "TEXT_PARTIAL"
|
||||
"fieldType": "URN_PARTIAL"
|
||||
}
|
||||
urn: GlossaryTermUrn
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user