Skip to content

Commit

Permalink
fix(search): Handle .keyword properly in the entity type query to ind… (
Browse files Browse the repository at this point in the history
datahub-project#7957)

Co-authored-by: Indy Prentice <[email protected]>
  • Loading branch information
iprentic and Indy Prentice authored May 4, 2023
1 parent abeda11 commit 27c7c40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
public class ResolverUtils {

private static final Set<String> KEYWORD_EXCLUDED_FILTERS = ImmutableSet.of(
"runId"
"runId",
"_entityType"
);
private static final ObjectMapper MAPPER = new ObjectMapper();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private static ConjunctiveCriterion transformConjunctiveCriterion(ConjunctiveCri
IndexConvention indexConvention) {
return new ConjunctiveCriterion().setAnd(
conjunctiveCriterion.getAnd().stream().map(
criterion -> criterion.getField().equals("_entityType")
criterion -> criterion.getField().equalsIgnoreCase("_entityType")
? transformEntityTypeCriterion(criterion, indexConvention)
: criterion)
.collect(Collectors.toCollection(CriterionArray::new)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class SearchFieldConfig {
public static final float DEFAULT_BOOST = 1.0f;

public static final Set<String> KEYWORD_FIELDS = Set.of("urn", "runId");
public static final Set<String> KEYWORD_FIELDS = Set.of("urn", "runId", "_index");

// These should not be used directly since there is a specific
// order in which these rules need to be evaluated for exceptions to
Expand Down

0 comments on commit 27c7c40

Please sign in to comment.