Ejemplo n.º 1
0
  private boolean skipIndexingForType(String type, ApplicationScope applicationScope) {

    boolean skipIndexing = false;

    MapManager mm = getMapManagerForTypes(applicationScope);
    IndexSchemaCache indexSchemaCache = indexSchemaCacheFactory.getInstance(mm);
    String collectionName = Schema.defaultCollectionName(type);
    Optional<Map> collectionIndexingSchema = indexSchemaCache.getCollectionSchema(collectionName);

    if (collectionIndexingSchema.isPresent()) {
      Map jsonMapData = collectionIndexingSchema.get();
      final ArrayList fields = (ArrayList) jsonMapData.get("fields");
      if (fields.size() == 1 && fields.get(0).equals("none")) {
        skipIndexing = true;
      }
    }

    return skipIndexing;
  }