mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-21 07:38:13 +00:00
corp-identity-gms 1.0.25 -> 1.0.26:
1.0.26: Add get_all resource for CorpUsers metadata-models 38.1.8 -> 38.1.12: 38.1.12: Remove default filtering on removed field for get_all 38.1.11: Add index builders for datasets and corp groups 38.1.8: Add getFilter method as a search util MP_VERSION=corp-identity-gms:1.0.26 MP_VERSION=metadata-models:38.1.12 MP_VERSION=wherehows-samza:1.0.31
This commit is contained in:
parent
878cb6dde2
commit
9878cfe632
@ -30,7 +30,7 @@ public class ESUtils {
|
||||
BoolQueryBuilder filters = new BoolQueryBuilder();
|
||||
// TODO: Remove checking for urn after solving META-10102
|
||||
Arrays.stream(Urn.isUrn(entry.getValue()) ? new String[]{entry.getValue()} : entry.getValue().split(","))
|
||||
.forEach(elem -> filters.should(QueryBuilders.matchQuery(entry.getKey(), elem)));
|
||||
.forEach(elem -> filters.should(QueryBuilders.matchQuery(entry.getKey(), elem)));
|
||||
boolFilter.must(filters);
|
||||
}
|
||||
return boolFilter;
|
||||
|
@ -7,7 +7,6 @@ import com.linkedin.metadata.dao.BaseSearchDAO;
|
||||
import com.linkedin.metadata.dao.SearchResult;
|
||||
import com.linkedin.metadata.dao.utils.ModelUtils;
|
||||
import com.linkedin.metadata.query.AutoCompleteResult;
|
||||
import com.linkedin.metadata.query.Criterion;
|
||||
import com.linkedin.metadata.query.CriterionArray;
|
||||
import com.linkedin.metadata.query.Filter;
|
||||
import com.linkedin.metadata.query.SearchResultMetadata;
|
||||
@ -57,7 +56,6 @@ public abstract class BaseSearchableEntityResource<
|
||||
|
||||
private static final Filter EMPTY_FILTER = new Filter().setCriteria(new CriterionArray());
|
||||
private static final String MATCH_ALL = "*";
|
||||
private static final String REMOVED_FIELD = "removed";
|
||||
private static final String DEFAULT_SORT_CRITERION_FIELD = "urn";
|
||||
|
||||
public BaseSearchableEntityResource(@Nonnull Class<SNAPSHOT> snapshotClass,
|
||||
@ -72,7 +70,7 @@ public abstract class BaseSearchableEntityResource<
|
||||
protected abstract BaseSearchDAO<DOCUMENT> getSearchDAO();
|
||||
|
||||
/**
|
||||
* Returns all {@link VALUE} objects from search index which by default are NOT removed. By default the list is sorted in ascending order of urn
|
||||
* Returns all {@link VALUE} objects from search index. By default the list is sorted in ascending order of urn
|
||||
*
|
||||
* @param pagingContext pagination context
|
||||
* @param aspectNames list of aspect names that need to be returned
|
||||
@ -88,12 +86,6 @@ public abstract class BaseSearchableEntityResource<
|
||||
@QueryParam(PARAM_SORT) @Optional @Nullable SortCriterion sortCriterion) {
|
||||
|
||||
final Filter searchFilter = filter != null ? filter : EMPTY_FILTER;
|
||||
if (searchFilter.hasCriteria() && searchFilter.getCriteria()
|
||||
.stream()
|
||||
.noneMatch(t -> t.getField().equals(REMOVED_FIELD))) {
|
||||
searchFilter.getCriteria().add(new Criterion().setField(REMOVED_FIELD).setValue("false"));
|
||||
}
|
||||
|
||||
final SortCriterion searchSortCriterion = sortCriterion != null ? sortCriterion
|
||||
: new SortCriterion().setField(DEFAULT_SORT_CRITERION_FIELD).setOrder(SortOrder.ASCENDING);
|
||||
return RestliUtils.toTask(
|
||||
|
@ -204,7 +204,6 @@ public class BaseSearchableEntityResourceTest extends BaseEngineTest {
|
||||
AspectKey<Urn, AspectFoo> aspectKey2 = new AspectKey<>(AspectFoo.class, urn2, BaseLocalDAO.LATEST_VERSION);
|
||||
|
||||
Filter filter1 = new Filter().setCriteria(new CriterionArray());
|
||||
filter1.getCriteria().add(new Criterion().setField("removed").setValue("false"));
|
||||
SortCriterion sortCriterion1 = new SortCriterion().setField("urn").setOrder(SortOrder.ASCENDING);
|
||||
|
||||
when(_mockSearchDAO.search("*", filter1, sortCriterion1, 1, 2)).thenReturn(
|
||||
|
Loading…
x
Reference in New Issue
Block a user