Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(search): fix field name in api #10170

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.linkedin.metadata.graph.elastic;

import static com.linkedin.metadata.graph.Edge.*;
import static com.linkedin.metadata.graph.elastic.ElasticSearchGraphService.*;
import static com.linkedin.metadata.graph.elastic.GraphRelationshipMappingsBuilder.*;

import com.codahale.metrics.Timer;
import com.datahub.util.exception.ESQueryException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.linkedin.metadata.graph.elastic;

import static com.linkedin.metadata.graph.elastic.GraphRelationshipMappingsBuilder.*;
import static com.linkedin.metadata.graph.Edge.*;

import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package com.linkedin.metadata.graph.elastic;

import static com.linkedin.metadata.graph.Edge.*;

import com.google.common.collect.ImmutableMap;
import java.util.HashMap;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class GraphRelationshipMappingsBuilder {
public static final String EDGE_FIELD_SOURCE = "source";
public static final String EDGE_FIELD_DESTINATION = "destination";
public static final String EDGE_FIELD_RELNSHIP_TYPE = "relationshipType";
public static final String EDGE_FIELD_PROPERTIES = "properties";
public static final String EDGE_FIELD_VIA = "via";
public static final String EDGE_FIELD_LIFECYCLE_OWNER = "lifecycleOwner";

private GraphRelationshipMappingsBuilder() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,21 @@ public String toDocId() {
}
}

public static final String SOURCE_URN_FIELD = "source.urn";
public static final String DESTINATION_URN_FIELD = "destination.urn";
public static final String RELATIONSHIP_TYPE_FIELD = "relationshipType";
public static final String LIFE_CYCLE_OWNER_FIELD = "lifeCycleOwner";
public static final String EDGE_FIELD_SOURCE = "source";
public static final String EDGE_FIELD_DESTINATION = "destination";
public static final String EDGE_FIELD_RELNSHIP_TYPE = "relationshipType";
public static final String EDGE_FIELD_PROPERTIES = "properties";
public static final String EDGE_FIELD_VIA = "via";
public static final String EDGE_FIELD_LIFECYCLE_OWNER = "lifecycleOwner";
public static final String EDGE_SOURCE_URN_FIELD = "source.urn";
public static final String EDGE_DESTINATION_URN_FIELD = "destination.urn";

public static final List<Pair<String, SortOrder>> KEY_SORTS =
List.of(
new Pair<>(SOURCE_URN_FIELD, SortOrder.ASCENDING),
new Pair<>(DESTINATION_URN_FIELD, SortOrder.ASCENDING),
new Pair<>(RELATIONSHIP_TYPE_FIELD, SortOrder.ASCENDING),
new Pair<>(LIFE_CYCLE_OWNER_FIELD, SortOrder.ASCENDING));
new Pair<>(EDGE_SOURCE_URN_FIELD, SortOrder.ASCENDING),
new Pair<>(EDGE_DESTINATION_URN_FIELD, SortOrder.ASCENDING),
new Pair<>(EDGE_FIELD_RELNSHIP_TYPE, SortOrder.ASCENDING),
new Pair<>(EDGE_FIELD_LIFECYCLE_OWNER, SortOrder.ASCENDING));
public static List<SortCriterion> EDGE_SORT_CRITERION =
KEY_SORTS.stream()
.map(entry -> SearchUtil.sortBy(entry.getKey(), entry.getValue()))
Expand Down
Loading