public class IndexRequest
extends java.lang.Object
Constructor and Description |
---|
IndexRequest(BsonDocument keys)
Construct a new instance with the given keys
|
Modifier and Type | Method and Description |
---|---|
IndexRequest |
background(boolean background)
Should the index should be created in the background
|
IndexRequest |
bits(java.lang.Integer bits)
Sets the number of precision of the stored geohash value of the location data in 2d indexes.
|
IndexRequest |
bucketSize(java.lang.Double bucketSize)
Sets the specified the number of units within which to group the location values for geoHaystack Indexes
|
IndexRequest |
collation(Collation collation)
Sets the collation options
|
IndexRequest |
defaultLanguage(java.lang.String defaultLanguage)
Sets the language for the text index.
|
IndexRequest |
dropDups(boolean dropDups)
Sets the legacy dropDups setting
|
IndexRequest |
expireAfter(java.lang.Long expireAfter,
java.util.concurrent.TimeUnit timeUnit)
Sets the time to live for documents in the collection
|
java.lang.Integer |
getBits()
Gets the number of precision of the stored geohash value of the location data in 2d indexes.
|
java.lang.Double |
getBucketSize()
Gets the specified the number of units within which to group the location values for geoHaystack Indexes
|
Collation |
getCollation()
Returns the collation options
|
java.lang.String |
getDefaultLanguage()
Gets the language for a text index.
|
boolean |
getDropDups()
Returns the legacy dropDups setting
|
java.lang.Long |
getExpireAfter(java.util.concurrent.TimeUnit timeUnit)
Gets the time to live for documents in the collection
|
BsonDocument |
getKeys()
Gets the index keys
|
java.lang.String |
getLanguageOverride()
Gets the name of the field that contains the language string.
|
java.lang.Double |
getMax()
Gets the upper inclusive boundary for the longitude and latitude values for 2d indexes..
|
java.lang.Double |
getMin()
Gets the lower inclusive boundary for the longitude and latitude values for 2d indexes..
|
java.lang.String |
getName()
Gets the name of the index.
|
BsonDocument |
getPartialFilterExpression()
Get the filter expression for the documents to be included in the index or null if not set
|
java.lang.Integer |
getSphereVersion()
Gets the 2dsphere index version number.
|
BsonDocument |
getStorageEngine()
Gets the storage engine options document for this index.
|
java.lang.Integer |
getTextVersion()
The text index version number.
|
java.lang.Integer |
getVersion()
Gets the index version number.
|
BsonDocument |
getWeights()
Gets the weighting object for use with a text index
|
boolean |
isBackground()
Create the index in the background
|
boolean |
isSparse()
If true, the index only references documents with the specified field
|
boolean |
isUnique()
Gets if the index should be unique.
|
IndexRequest |
languageOverride(java.lang.String languageOverride)
Sets the name of the field that contains the language string.
|
IndexRequest |
max(java.lang.Double max)
Sets the upper inclusive boundary for the longitude and latitude values for 2d indexes..
|
IndexRequest |
min(java.lang.Double min)
Sets the lower inclusive boundary for the longitude and latitude values for 2d indexes..
|
IndexRequest |
name(java.lang.String name)
Sets the name of the index.
|
IndexRequest |
partialFilterExpression(BsonDocument partialFilterExpression)
Sets the filter expression for the documents to be included in the index
|
IndexRequest |
sparse(boolean sparse)
Should the index only references documents with the specified field
|
IndexRequest |
sphereVersion(java.lang.Integer sphereVersion)
Sets the 2dsphere index version number.
|
IndexRequest |
storageEngine(BsonDocument storageEngineOptions)
Sets the storage engine options document for this index.
|
IndexRequest |
textVersion(java.lang.Integer textVersion)
Set the text index version number.
|
IndexRequest |
unique(boolean unique)
Should the index should be unique.
|
IndexRequest |
version(java.lang.Integer version)
Sets the index version number.
|
IndexRequest |
weights(BsonDocument weights)
Sets the weighting object for use with a text index.
|
public IndexRequest(BsonDocument keys)
keys
- the index keyspublic BsonDocument getKeys()
public boolean isBackground()
public IndexRequest background(boolean background)
background
- true if should create the index in the backgroundpublic boolean isUnique()
public IndexRequest unique(boolean unique)
unique
- if the index should be uniquepublic java.lang.String getName()
public IndexRequest name(java.lang.String name)
name
- of the indexpublic boolean isSparse()
public IndexRequest sparse(boolean sparse)
sparse
- if true, the index only references documents with the specified fieldpublic java.lang.Long getExpireAfter(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the time unitpublic IndexRequest expireAfter(java.lang.Long expireAfter, java.util.concurrent.TimeUnit timeUnit)
expireAfter
- the time to live for documents in the collectiontimeUnit
- the time unitpublic java.lang.Integer getVersion()
public IndexRequest version(java.lang.Integer version)
version
- the index version numberpublic BsonDocument getWeights()
A document that represents field and weight pairs. The weight is an integer ranging from 1 to 99,999 and denotes the significance of the field relative to the other indexed fields in terms of the score.
public IndexRequest weights(BsonDocument weights)
An document that represents field and weight pairs. The weight is an integer ranging from 1 to 99,999 and denotes the significance of the field relative to the other indexed fields in terms of the score.
weights
- the weighting objectpublic java.lang.String getDefaultLanguage()
The language that determines the list of stop words and the rules for the stemmer and tokenizer.
public IndexRequest defaultLanguage(java.lang.String defaultLanguage)
The language that determines the list of stop words and the rules for the stemmer and tokenizer.
defaultLanguage
- the language for the text index.public java.lang.String getLanguageOverride()
For text indexes, the name of the field, in the collection's documents, that contains the override language for the document.
public IndexRequest languageOverride(java.lang.String languageOverride)
For text indexes, the name of the field, in the collection's documents, that contains the override language for the document.
languageOverride
- the name of the field that contains the language string.public java.lang.Integer getTextVersion()
public IndexRequest textVersion(java.lang.Integer textVersion)
textVersion
- the text index version number.public java.lang.Integer getSphereVersion()
public IndexRequest sphereVersion(java.lang.Integer sphereVersion)
sphereVersion
- the 2dsphere index version number.public java.lang.Integer getBits()
public IndexRequest bits(java.lang.Integer bits)
bits
- the number of precision of the stored geohash valuepublic java.lang.Double getMin()
public IndexRequest min(java.lang.Double min)
min
- the lower inclusive boundary for the longitude and latitude valuespublic java.lang.Double getMax()
public IndexRequest max(java.lang.Double max)
max
- the upper inclusive boundary for the longitude and latitude valuespublic java.lang.Double getBucketSize()
public IndexRequest bucketSize(java.lang.Double bucketSize)
bucketSize
- the specified the number of units within which to group the location values for geoHaystack Indexespublic boolean getDropDups()
Prior to MongoDB 3.0 dropDups could be used with unique indexes allowing documents with duplicate values to be dropped when building the index. Later versions of MongoDB will silently ignore this setting.
public IndexRequest dropDups(boolean dropDups)
Prior to MongoDB 3.0 dropDups could be used with unique indexes allowing documents with duplicate values to be dropped when building the index. Later versions of MongoDB will silently ignore this setting.
dropDups
- the legacy dropDups settingpublic BsonDocument getStorageEngine()
public IndexRequest storageEngine(BsonDocument storageEngineOptions)
storageEngineOptions
- the storage engine optionspublic BsonDocument getPartialFilterExpression()
public IndexRequest partialFilterExpression(BsonDocument partialFilterExpression)
partialFilterExpression
- the filter expression for the documents to be included in the indexpublic Collation getCollation()
public IndexRequest collation(Collation collation)
A null value represents the server default.
collation
- the collation options to use