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

David leifker/elasticsearch optimization ext #6922

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
Expand Up @@ -9,7 +9,6 @@
import com.linkedin.metadata.search.ranker.SearchRanker;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ private static Map<String, Object> buildAnalyzers(String mainTokenizer) {
// Analyzer for case-insensitive exact matching - Only used when building queries
analyzers.put(KEYWORD_LOWERCASE_ANALYZER, ImmutableMap.<String, Object>builder()
.put(TOKENIZER, KEYWORD_TOKENIZER)
.put(FILTER, ImmutableList.of("trim", LOWERCASE, ASCII_FOLDING))
.put(FILTER, ImmutableList.of("trim", LOWERCASE, ASCII_FOLDING, SNOWBALL))
.build());

// Analyzer for getting urn components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,17 @@ public void testSmokeTestQueries() {
String.format("Search term `%s` has %s fulltext results, expected %s results.", key,
actualCount, expectedCount));
});

results = expectedMinimums.entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, entry -> searchStructured(searchService, entry.getKey())));

results.forEach((key, value) -> {
Integer actualCount = value.getEntities().size();
Integer expectedCount = expectedMinimums.get(key);
assertTrue(actualCount >= expectedCount,
String.format("Search term `%s` has %s structured results, expected %s results.", key,
actualCount, expectedCount));
});
}

@Test
Expand Down