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

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

There is a newer version: 1.5.11
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.Chart;
import org.openmetadata.service.Entity;
import org.openmetadata.service.search.models.SearchSuggest;

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

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

  public Map buildSearchIndexDocInternal(Map esDoc) {
    Map commonAttributes = getCommonAttributesMap(chart, Entity.CHART);
    esDoc.putAll(commonAttributes);
    return esDoc;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy