Package com.ibm.cloud.cloudant.v1.model
Class IndexDefinition
java.lang.Object
com.ibm.cloud.sdk.core.service.model.GenericModel
com.ibm.cloud.cloudant.v1.model.IndexDefinition
- All Implemented Interfaces:
com.ibm.cloud.sdk.core.service.model.ObjectModel
public class IndexDefinition
extends com.ibm.cloud.sdk.core.service.model.GenericModel
Schema for a `json` or `text` query index definition. Indexes of type `text` have additional configuration properties
that do not apply to `json` indexes, these are:
* `default_analyzer` - the default text analyzer to use * `default_field` - whether to index the text in all document
fields and what analyzer to use for that purpose.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the defaultAnalyzer.Gets the defaultField.fields()
Gets the fields.Gets the indexArrayLengths.New builder.Gets the partialFilterSelector.Methods inherited from class com.ibm.cloud.sdk.core.service.model.GenericModel
equals, hashCode, toString
-
Method Details
-
newBuilder
New builder.- Returns:
- a IndexDefinition builder
-
defaultAnalyzer
Gets the defaultAnalyzer. Schema for a full text search analyzer.- Returns:
- the defaultAnalyzer
-
defaultField
Gets the defaultField. Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the `$text` operator.- Returns:
- the defaultField
-
fields
Gets the fields. List of field objects to index. Nested fields are also allowed, e.g. `person.name`. For "json" type indexes each object is a mapping of field name to sort direction (asc or desc). For "text" type indexes each object has a `name` property of the field name and a `type` property of the field type (string, number, or boolean).- Returns:
- the fields
-
indexArrayLengths
Gets the indexArrayLengths. Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if: * You do not need to know the length of an array. * You do not use the `$size` operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.- Returns:
- the indexArrayLengths
-
partialFilterSelector
Gets the partialFilterSelector. JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must: * Be structured as valid JSON. * Contain a valid query expression. Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign `$` prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied argument. See [the Cloudant Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).- Returns:
- the partialFilterSelector
-