All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openmetadata.service.search.indexes.APICollectionIndex Maven / Gradle / Ivy

There is a newer version: 1.5.4
Show newest version
package org.openmetadata.service.search.indexes;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.openmetadata.schema.entity.data.APICollection;
import org.openmetadata.service.Entity;
import org.openmetadata.service.search.models.SearchSuggest;

public record APICollectionIndex(APICollection apiCollection) implements SearchIndex {
  @Override
  public List getSuggest() {
    List suggest = new ArrayList<>();
    suggest.add(SearchSuggest.builder().input(apiCollection.getName()).weight(5).build());
    suggest.add(
        SearchSuggest.builder().input(apiCollection.getFullyQualifiedName()).weight(5).build());
    return suggest;
  }

  @Override
  public Object getEntity() {
    return apiCollection;
  }

  public Map buildSearchIndexDocInternal(Map doc) {
    Map commonAttributes =
        getCommonAttributesMap(apiCollection, Entity.API_COLLCECTION);
    doc.putAll(commonAttributes);
    return doc;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy