org.openmetadata.service.search.indexes.SearchServiceIndex 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.SearchService;
import org.openmetadata.service.Entity;
import org.openmetadata.service.search.models.SearchSuggest;
public record SearchServiceIndex(SearchService searchService) implements SearchIndex {
@Override
public List getSuggest() {
List suggest = new ArrayList<>();
suggest.add(SearchSuggest.builder().input(searchService.getName()).weight(5).build());
suggest.add(
SearchSuggest.builder().input(searchService.getFullyQualifiedName()).weight(5).build());
return suggest;
}
@Override
public Object getEntity() {
return searchService;
}
public Map buildSearchIndexDocInternal(Map doc) {
Map commonAttributes =
getCommonAttributesMap(searchService, Entity.SEARCH_SERVICE);
doc.putAll(commonAttributes);
return doc;
}
}