Skip to content

Commit

Permalink
#270 Added mlUpdateIndexes
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrudin committed Jan 26, 2018
1 parent edd262f commit 98f95b0
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/local-testing-project/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set this to the version you used when running
# "gradle -Pversion=(something) publishToMavenLocal" on your local ml-gradle repo
mlGradleVersion=3.3.0
mlGradleVersion=3.4-beta1

mlHost=localhost
mlAppName=example
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=com.marklogic
version=3.3.1
mlAppDeployerDependency=com.marklogic:ml-app-deployer:3.3.1
version=3.4-beta1
mlAppDeployerDependency=com.marklogic:ml-app-deployer:3.4-beta1
mlcpUtilDependency=com.marklogic:mlcp-util:0.3.0

Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class MarkLogicPlugin implements Plugin<Project> {
project.task("mlReindexContentDatabase", type: ReindexContentDatabaseTask, group: dbGroup, description: "Reindex the database named by mlAppConfig.contentDatabaseName")
project.task("mlReindexDatabase", type: ReindexDatabaseTask, group: dbGroup, description: "Reindex the database named by the project property dbName; e.g. gradle mlReindexDatabase -PdbName=my-database")
project.task("mlSetContentUpdatesAllowed", type: SetContentUpdatesAllowedTask, group: dbGroup, description: "Sets updated-allowed on each primary forest for the content database; must set the mode via e.g. -Pmode=flash-backup")
project.task("mlUpdateIndexes", type: UpdateIndexesTask, group: dbGroup, description: "Update every database by sending a payload that only contains properties related to how data is indexed")

String dmGroup = "ml-Gradle Data Movement"
String dmMessage = "Run with -PjobProperties (no value needed) for more information."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package com.marklogic.gradle.task.databases

import com.marklogic.gradle.task.MarkLogicTask
import org.gradle.api.tasks.TaskAction

class UpdateIndexesTask extends MarkLogicTask {

@TaskAction
void updateIndexes() {
getAppConfig().setIncludeProperties(
"database-name",
"stemmed-searches",
"word-searches",
"word-positions",
"fast-phrase-searches",
"fast-reverse-searches",
"triple-index",
"triple-positions",
"fast-case-sensitive-searches",
"fast-diacritic-sensitive-searches",
"fast-element-word-searches",
"element-word-positions",
"fast-element-phrase-searches",
"element-value-positions",
"attribute-value-positions",
"field-value-searches",
"field-value-positions",
"three-character-searches",
"three-character-word-positions",
"fast-element-character-searches",
"trailing-wildcard-searches",
"trailing-wildcard-word-positions",
"fast-element-trailing-wildcard-searches",
"word-lexicon",
"word-lexicons",
"two-character-searches",
"one-character-searches",
"uri-lexicon",
"collection-lexicon",
"element-word-query-through",
"element-word-query-throughs",
"phrase-through",
"phrase-throughs",
"phrase-around",
"phrase-arounds",
"range-element-index",
"range-element-indexes",
"range-element-attribute-index",
"range-element-attribute-indexes",
"range-path-index",
"range-path-indexes",
"range-field-index",
"range-field-indexes",
"field",
"fields",
"geospatial-element-index",
"geospatial-element-indexes",
"geospatial-element-child-index",
"geospatial-element-child-indexes",
"geospatial-element-pair-index",
"geospatial-element-pair-indexes",
"geospatial-element-attribute-pair-index",
"geospatial-element-attribute-pair-indexes",
"geospatial-path-index",
"geospatial-path-indexes",
"geospatial-region-path-index",
"geospatial-region-path-indexes"
)

deployWithCommandListProperty("mlDatabaseCommands")
}
}

0 comments on commit 98f95b0

Please sign in to comment.