org.openmetadata.service.search.indexes.MessagingServiceIndex Maven / Gradle / Ivy
package org.openmetadata.service.search.indexes;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.openmetadata.schema.entity.services.MessagingService;
import org.openmetadata.service.Entity;
import org.openmetadata.service.search.models.SearchSuggest;
public record MessagingServiceIndex(MessagingService messagingService) implements SearchIndex {
@Override
public List getSuggest() {
List suggest = new ArrayList<>();
suggest.add(SearchSuggest.builder().input(messagingService.getName()).weight(5).build());
suggest.add(
SearchSuggest.builder().input(messagingService.getFullyQualifiedName()).weight(5).build());
return suggest;
}
@Override
public Object getEntity() {
return messagingService;
}
public Map buildSearchIndexDocInternal(Map doc) {
Map commonAttributes =
getCommonAttributesMap(messagingService, Entity.MESSAGING_SERVICE);
doc.putAll(commonAttributes);
return doc;
}
}