public static ConditionTemplate schemaTypeIsNotIn(List<String> types) {
   List<LogicalSearchValueCondition> schemaTypesCriteria = new ArrayList<>();
   for (String type : types) {
     schemaTypesCriteria.add(LogicalSearchQueryOperators.startingWithText(type));
   }
   return ConditionTemplate.field(Schemas.SCHEMA, not(any(schemaTypesCriteria)));
 }
예제 #2
0
 private void setCategoriesAndClassificationIdsList() {
   SearchServices searchServices = getSearchServices();
   MetadataSchema categorySchema =
       getMetadataSchemasManager().getSchemaTypes(COLLECTION).getSchema(Category.DEFAULT_SCHEMA);
   MetadataSchema administrativeUnitSchema =
       getMetadataSchemasManager()
           .getSchemaTypes(COLLECTION)
           .getSchema(AdministrativeUnit.DEFAULT_SCHEMA);
   Metadata filingSpaceMetadata =
       administrativeUnitSchema.getMetadata(AdministrativeUnit.FILING_SPACES);
   Metadata parentCategoryMetadata = categorySchema.getMetadata("parent");
   level1And2CategoryIds =
       searchServices.searchRecordIds(
           new LogicalSearchQuery(
               LogicalSearchQueryOperators.from(categorySchema)
                   .where(parentCategoryMetadata)
                   .isNotNull()));
   administrativeUnits =
       searchServices.search(
           new LogicalSearchQuery(
               LogicalSearchQueryOperators.from(administrativeUnitSchema)
                   .where(filingSpaceMetadata)
                   .isNotNull()));
 }