oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/util/IndexDefinitionUtils.java [48:143]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static NodeBuilder newFTIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes) {
        return newFTIndexDefinition(index, name, type, propertyTypes, null, null, null);
    }

    public static NodeBuilder newFTIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes,
        @Nullable Set<String> excludes, @Nullable String async) {
        return newFTIndexDefinition(index, type, name, propertyTypes, excludes,
                async, null);
    }

    public static NodeBuilder newFTIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes,
        @Nullable Set<String> excludes, @Nullable String async,
        @Nullable Boolean stored) {
        if (index.hasChildNode(name)) {
            return index.child(name);
        }
        index = index.child(name);
        index.setProperty(JCR_PRIMARYTYPE, INDEX_DEFINITIONS_NODE_TYPE, NAME)
                .setProperty(TYPE_PROPERTY_NAME, type)
                .setProperty(REINDEX_PROPERTY_NAME, true);
        if (async != null) {
            index.setProperty(ASYNC_PROPERTY_NAME, async);
        }
        if (propertyTypes != null && !propertyTypes.isEmpty()) {
            index.setProperty(createProperty(INCLUDE_PROPERTY_TYPES,
                    propertyTypes, STRINGS));
        }
        if (excludes != null && !excludes.isEmpty()) {
            index.setProperty(createProperty(EXCLUDE_PROPERTY_NAMES, excludes,
                    STRINGS));
        }
        if (stored != null) {
            index.setProperty(createProperty(EXPERIMENTAL_STORAGE, stored));
        }
        return index;
    }

    public static NodeBuilder newFTFileIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes, @NotNull String path) {
        return newFTFileIndexDefinition(index, type, name, propertyTypes, null,
                path, null);
    }

    public static NodeBuilder newFTFileIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes,
        @Nullable Set<String> excludes, @NotNull String path,
        @Nullable String async) {
        if (index.hasChildNode(name)) {
            return index.child(name);
        }
        index = index.child(name);
        index.setProperty(JCR_PRIMARYTYPE, INDEX_DEFINITIONS_NODE_TYPE, NAME)
                .setProperty(TYPE_PROPERTY_NAME, type)
                .setProperty(PERSISTENCE_NAME, PERSISTENCE_FILE)
                .setProperty(PERSISTENCE_PATH, path)
                .setProperty(REINDEX_PROPERTY_NAME, true);
        if (async != null) {
            index.setProperty(ASYNC_PROPERTY_NAME, async);
        }
        if (propertyTypes != null && !propertyTypes.isEmpty()) {
            index.setProperty(createProperty(INCLUDE_PROPERTY_TYPES,
                    propertyTypes, STRINGS));
        }
        if (excludes != null && !excludes.isEmpty()) {
            index.setProperty(createProperty(EXCLUDE_PROPERTY_NAMES, excludes,
                    STRINGS));
        }
        return index;
    }

    public static NodeBuilder newFTPropertyIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @NotNull Set<String> includes,
        @NotNull String async) {
        checkArgument(!includes.isEmpty(), "Fulltext property index " +
                "requires explicit list of property names to be indexed");

        index = index.child(name);
        index.setProperty(JCR_PRIMARYTYPE, INDEX_DEFINITIONS_NODE_TYPE, NAME)
                .setProperty(TYPE_PROPERTY_NAME, type)
                .setProperty(REINDEX_PROPERTY_NAME, true);
        index.setProperty(FulltextIndexConstants.FULL_TEXT_ENABLED, false);
        index.setProperty(createProperty(INCLUDE_PROPERTY_NAMES, includes, STRINGS));

        if (async != null) {
            index.setProperty(ASYNC_PROPERTY_NAME, async);
        }
        return index;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/util/IndexHelper.java [70:165]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static NodeBuilder newFTIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes) {
        return newFTIndexDefinition(index, name, type, propertyTypes, null, null, null);
    }

    public static NodeBuilder newFTIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes,
        @Nullable Set<String> excludes, @Nullable String async) {
        return newFTIndexDefinition(index, type, name, propertyTypes, excludes,
                async, null);
    }

    public static NodeBuilder newFTIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes,
        @Nullable Set<String> excludes, @Nullable String async,
        @Nullable Boolean stored) {
        if (index.hasChildNode(name)) {
            return index.child(name);
        }
        index = index.child(name);
        index.setProperty(JCR_PRIMARYTYPE, INDEX_DEFINITIONS_NODE_TYPE, NAME)
                .setProperty(TYPE_PROPERTY_NAME, type)
                .setProperty(REINDEX_PROPERTY_NAME, true);
        if (async != null) {
            index.setProperty(ASYNC_PROPERTY_NAME, async);
        }
        if (propertyTypes != null && !propertyTypes.isEmpty()) {
            index.setProperty(createProperty(INCLUDE_PROPERTY_TYPES,
                    propertyTypes, STRINGS));
        }
        if (excludes != null && !excludes.isEmpty()) {
            index.setProperty(createProperty(EXCLUDE_PROPERTY_NAMES, excludes,
                    STRINGS));
        }
        if (stored != null) {
            index.setProperty(createProperty(EXPERIMENTAL_STORAGE, stored));
        }
        return index;
    }

    public static NodeBuilder newFTFileIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes, @NotNull String path) {
        return newFTFileIndexDefinition(index, type, name, propertyTypes, null,
                path, null);
    }

    public static NodeBuilder newFTFileIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @Nullable Set<String> propertyTypes,
        @Nullable Set<String> excludes, @NotNull String path,
        @Nullable String async) {
        if (index.hasChildNode(name)) {
            return index.child(name);
        }
        index = index.child(name);
        index.setProperty(JCR_PRIMARYTYPE, INDEX_DEFINITIONS_NODE_TYPE, NAME)
                .setProperty(TYPE_PROPERTY_NAME, type)
                .setProperty(PERSISTENCE_NAME, PERSISTENCE_FILE)
                .setProperty(PERSISTENCE_PATH, path)
                .setProperty(REINDEX_PROPERTY_NAME, true);
        if (async != null) {
            index.setProperty(ASYNC_PROPERTY_NAME, async);
        }
        if (propertyTypes != null && !propertyTypes.isEmpty()) {
            index.setProperty(createProperty(INCLUDE_PROPERTY_TYPES,
                    propertyTypes, STRINGS));
        }
        if (excludes != null && !excludes.isEmpty()) {
            index.setProperty(createProperty(EXCLUDE_PROPERTY_NAMES, excludes,
                    STRINGS));
        }
        return index;
    }

    public static NodeBuilder newFTPropertyIndexDefinition(
        @NotNull NodeBuilder index, @NotNull String name, String type,
        @NotNull Set<String> includes,
        @NotNull String async) {
        checkArgument(!includes.isEmpty(), "Fulltext property index " +
                "requires explicit list of property names to be indexed");

        index = index.child(name);
        index.setProperty(JCR_PRIMARYTYPE, INDEX_DEFINITIONS_NODE_TYPE, NAME)
                .setProperty(TYPE_PROPERTY_NAME, type)
                .setProperty(REINDEX_PROPERTY_NAME, true);
        index.setProperty(FulltextIndexConstants.FULL_TEXT_ENABLED, false);
        index.setProperty(createProperty(INCLUDE_PROPERTY_NAMES, includes, STRINGS));

        if (async != null) {
            index.setProperty(ASYNC_PROPERTY_NAME, async);
        }
        return index;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



