Operations: How to Change Index Priority
SetIndexesPriorityOperation allows you to change an index priority for a given index or indexes.
Syntax
public SetIndexesPriorityOperation(String indexName, IndexPriority priority) {
public SetIndexesPriorityOperation(SetIndexesPriorityOperation.Parameters parameters)
public enum IndexPriority {
LOW,
NORMAL,
HIGH
}
public static class Parameters {
private String[] indexNames;
private IndexPriority priority;
public String[] getIndexNames() {
return indexNames;
}
public void setIndexNames(String[] indexNames) {
this.indexNames = indexNames;
}
public IndexPriority getPriority() {
return priority;
}
public void setPriority(IndexPriority priority) {
this.priority = priority;
}
}
Parameters | ||
---|---|---|
name | String | name of an index to change priority for |
priority | IndexingPriority | new index priority |
parameters | SetIndexesPriorityOperation.Parameters | list of indexes + new index priority |
Example I
store.maintenance().send(
new SetIndexesPriorityOperation("Orders/Totals", IndexPriority.HIGH));
Example II
SetIndexesPriorityOperation.Parameters parameters = new SetIndexesPriorityOperation.Parameters();
parameters.setIndexNames(new String[]{ "Orders/Totals", "Orders/ByCompany" });
parameters.setPriority(IndexPriority.LOW);
store.maintenance().send(new SetIndexesPriorityOperation(parameters));