public T index(boolean index) { if (index) { if (fieldType.indexOptions() == IndexOptions.NONE) { /* * the logic here is to reset to the default options only if we are not indexed ie. options are null * if the fieldType has a non-null option we are all good it might have been set through a different * call. */ IndexOptions options = getDefaultIndexOption(); if (options == IndexOptions.NONE) { // can happen when an existing type on the same index has disabled indexing // since we inherit the default field type from the first mapper that is // created on an index throw new IllegalArgumentException("mapper [" + name + "] has different [index] values from other types" + " of the same index"); } fieldType.setIndexOptions(options); } } else { fieldType.setIndexOptions(IndexOptions.NONE); } return builder; }
public T index(boolean index) { if (index) { if (fieldType.indexOptions() == IndexOptions.NONE) { /* * the logic here is to reset to the default options only if we are not indexed ie. options are null * if the fieldType has a non-null option we are all good it might have been set through a different * call. */ IndexOptions options = getDefaultIndexOption(); if (options == IndexOptions.NONE) { // can happen when an existing type on the same index has disabled indexing // since we inherit the default field type from the first mapper that is // created on an index throw new IllegalArgumentException("mapper [" + name + "] has different [index] values from other types of the same index"); } fieldType.setIndexOptions(options); } } else { fieldType.setIndexOptions(IndexOptions.NONE); } return builder; }
public T index(boolean index) { if (index) { if (fieldType.indexOptions() == IndexOptions.NONE) { /* * the logic here is to reset to the default options only if we are not indexed ie. options are null * if the fieldType has a non-null option we are all good it might have been set through a different * call. */ IndexOptions options = getDefaultIndexOption(); if (options == IndexOptions.NONE) { // can happen when an existing type on the same index has disabled indexing // since we inherit the default field type from the first mapper that is // created on an index throw new IllegalArgumentException("mapper [" + name + "] has different [index] values from other types of the same index"); } fieldType.setIndexOptions(options); } } else { fieldType.setIndexOptions(IndexOptions.NONE); } return builder; }
public T index(boolean index) { if (index) { if (fieldType.indexOptions() == IndexOptions.NONE) { /* * the logic here is to reset to the default options only if we are not indexed ie. options are null * if the fieldType has a non-null option we are all good it might have been set through a different * call. */ IndexOptions options = getDefaultIndexOption(); if (options == IndexOptions.NONE) { // can happen when an existing type on the same index has disabled indexing // since we inherit the default field type from the first mapper that is // created on an index throw new IllegalArgumentException("mapper [" + name + "] has different [index] values from other types of the same index"); } fieldType.setIndexOptions(options); } } else { fieldType.setIndexOptions(IndexOptions.NONE); } return builder; }
public T index(boolean index) { if (index) { if (fieldType.indexOptions() == IndexOptions.NONE) { /* * the logic here is to reset to the default options only if we are not indexed ie. options are null * if the fieldType has a non-null option we are all good it might have been set through a different * call. */ IndexOptions options = getDefaultIndexOption(); if (options == IndexOptions.NONE) { // can happen when an existing type on the same index has disabled indexing // since we inherit the default field type from the first mapper that is // created on an index throw new IllegalArgumentException("mapper [" + name + "] has different [index] values from other types of the same index"); } fieldType.setIndexOptions(options); } } else { fieldType.setIndexOptions(IndexOptions.NONE); } return builder; }