Class IndexRequest
- java.lang.Object
-
- com.mongodb.bulk.IndexRequest
-
@Deprecated public class IndexRequest extends Object
Deprecated.The settings to apply to the creation of an index.- Since:
- 3.0
- MongoDB documentation
- Index options
-
-
Constructor Summary
Constructors Constructor Description IndexRequest(BsonDocument keys)
Deprecated.Construct a new instance with the given keys
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IndexRequest
background(boolean background)
Deprecated.Should the index should be created in the backgroundIndexRequest
bits(Integer bits)
Deprecated.Sets the number of precision of the stored geohash value of the location data in 2d indexes.IndexRequest
bucketSize(Double bucketSize)
Deprecated.Sets the specified the number of units within which to group the location values for geoHaystack IndexesIndexRequest
collation(Collation collation)
Deprecated.Sets the collation optionsIndexRequest
defaultLanguage(String defaultLanguage)
Deprecated.Sets the language for the text index.IndexRequest
dropDups(boolean dropDups)
Deprecated.Sets the legacy dropDups settingIndexRequest
expireAfter(Long expireAfter, TimeUnit timeUnit)
Deprecated.Sets the time to live for documents in the collectionInteger
getBits()
Deprecated.Gets the number of precision of the stored geohash value of the location data in 2d indexes.Double
getBucketSize()
Deprecated.Gets the specified the number of units within which to group the location values for geoHaystack IndexesCollation
getCollation()
Deprecated.Returns the collation optionsString
getDefaultLanguage()
Deprecated.Gets the language for a text index.boolean
getDropDups()
Deprecated.Returns the legacy dropDups settingLong
getExpireAfter(TimeUnit timeUnit)
Deprecated.Gets the time to live for documents in the collectionBsonDocument
getKeys()
Deprecated.Gets the index keysString
getLanguageOverride()
Deprecated.Gets the name of the field that contains the language string.Double
getMax()
Deprecated.Gets the upper inclusive boundary for the longitude and latitude values for 2d indexes..Double
getMin()
Deprecated.Gets the lower inclusive boundary for the longitude and latitude values for 2d indexes..String
getName()
Deprecated.Gets the name of the index.BsonDocument
getPartialFilterExpression()
Deprecated.Get the filter expression for the documents to be included in the index or null if not setInteger
getSphereVersion()
Deprecated.Gets the 2dsphere index version number.BsonDocument
getStorageEngine()
Deprecated.Gets the storage engine options document for this index.Integer
getTextVersion()
Deprecated.The text index version number.Integer
getVersion()
Deprecated.Gets the index version number.BsonDocument
getWeights()
Deprecated.Gets the weighting object for use with a text indexBsonDocument
getWildcardProjection()
Deprecated.Gets the wildcard projection of a wildcard indexboolean
isBackground()
Deprecated.Create the index in the backgroundboolean
isSparse()
Deprecated.If true, the index only references documents with the specified fieldboolean
isUnique()
Deprecated.Gets if the index should be unique.IndexRequest
languageOverride(String languageOverride)
Deprecated.Sets the name of the field that contains the language string.IndexRequest
max(Double max)
Deprecated.Sets the upper inclusive boundary for the longitude and latitude values for 2d indexes..IndexRequest
min(Double min)
Deprecated.Sets the lower inclusive boundary for the longitude and latitude values for 2d indexes..IndexRequest
name(String name)
Deprecated.Sets the name of the index.IndexRequest
partialFilterExpression(BsonDocument partialFilterExpression)
Deprecated.Sets the filter expression for the documents to be included in the indexIndexRequest
sparse(boolean sparse)
Deprecated.Should the index only references documents with the specified fieldIndexRequest
sphereVersion(Integer sphereVersion)
Deprecated.Sets the 2dsphere index version number.IndexRequest
storageEngine(BsonDocument storageEngineOptions)
Deprecated.Sets the storage engine options document for this index.IndexRequest
textVersion(Integer textVersion)
Deprecated.Set the text index version number.IndexRequest
unique(boolean unique)
Deprecated.Should the index should be unique.IndexRequest
version(Integer version)
Deprecated.Sets the index version number.IndexRequest
weights(BsonDocument weights)
Deprecated.Sets the weighting object for use with a text index.IndexRequest
wildcardProjection(BsonDocument wildcardProjection)
Deprecated.Sets the wildcard projection of a wildcard index
-
-
-
Constructor Detail
-
IndexRequest
public IndexRequest(BsonDocument keys)
Deprecated.Construct a new instance with the given keys- Parameters:
keys
- the index keys
-
-
Method Detail
-
getKeys
public BsonDocument getKeys()
Deprecated.Gets the index keys- Returns:
- the index keys
-
isBackground
public boolean isBackground()
Deprecated.Create the index in the background- Returns:
- true if should create the index in the background
-
background
public IndexRequest background(boolean background)
Deprecated.Should the index should be created in the background- Parameters:
background
- true if should create the index in the background- Returns:
- this
-
isUnique
public boolean isUnique()
Deprecated.Gets if the index should be unique.- Returns:
- true if the index should be unique
-
unique
public IndexRequest unique(boolean unique)
Deprecated.Should the index should be unique.- Parameters:
unique
- if the index should be unique- Returns:
- this
-
getName
public String getName()
Deprecated.Gets the name of the index.- Returns:
- the name of the index
-
name
public IndexRequest name(String name)
Deprecated.Sets the name of the index.- Parameters:
name
- of the index- Returns:
- this
-
isSparse
public boolean isSparse()
Deprecated.If true, the index only references documents with the specified field- Returns:
- if the index should only reference documents with the specified field
-
sparse
public IndexRequest sparse(boolean sparse)
Deprecated.Should the index only references documents with the specified field- Parameters:
sparse
- if true, the index only references documents with the specified field- Returns:
- this
-
getExpireAfter
public Long getExpireAfter(TimeUnit timeUnit)
Deprecated.Gets the time to live for documents in the collection- Parameters:
timeUnit
- the time unit- Returns:
- the time to live for documents in the collection
- MongoDB documentation
- TTL
-
expireAfter
public IndexRequest expireAfter(Long expireAfter, TimeUnit timeUnit)
Deprecated.Sets the time to live for documents in the collection- Parameters:
expireAfter
- the time to live for documents in the collectiontimeUnit
- the time unit- Returns:
- this
- MongoDB documentation
- TTL
-
getVersion
public Integer getVersion()
Deprecated.Gets the index version number.- Returns:
- the index version number
-
version
public IndexRequest version(Integer version)
Deprecated.Sets the index version number.- Parameters:
version
- the index version number- Returns:
- this
-
getWeights
public BsonDocument getWeights()
Deprecated.Gets the weighting object for use with a text indexA 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.
- Returns:
- the weighting object
- MongoDB documentation
- Control Search Results with Weights
-
weights
public IndexRequest weights(BsonDocument weights)
Deprecated.Sets the weighting object for use with a text index.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.
- Parameters:
weights
- the weighting object- Returns:
- this
- MongoDB documentation
- Control Search Results with Weights
-
getDefaultLanguage
public String getDefaultLanguage()
Deprecated.Gets the language for a text index.The language that determines the list of stop words and the rules for the stemmer and tokenizer.
- Returns:
- the language for a text index.
- MongoDB documentation
- Text Search languages
-
defaultLanguage
public IndexRequest defaultLanguage(String defaultLanguage)
Deprecated.Sets the language for the text index.The language that determines the list of stop words and the rules for the stemmer and tokenizer.
- Parameters:
defaultLanguage
- the language for the text index.- Returns:
- this
- MongoDB documentation
- Text Search languages
-
getLanguageOverride
public String getLanguageOverride()
Deprecated.Gets the name of the field that contains the language string.For text indexes, the name of the field, in the collection's documents, that contains the override language for the document.
- Returns:
- the name of the field that contains the language string.
- MongoDB documentation
- Language override
-
languageOverride
public IndexRequest languageOverride(String languageOverride)
Deprecated.Sets the name of the field that contains the language string.For text indexes, the name of the field, in the collection's documents, that contains the override language for the document.
- Parameters:
languageOverride
- the name of the field that contains the language string.- Returns:
- this
- MongoDB documentation
- Language override
-
getTextVersion
public Integer getTextVersion()
Deprecated.The text index version number.- Returns:
- the text index version number.
-
textVersion
public IndexRequest textVersion(Integer textVersion)
Deprecated.Set the text index version number.- Parameters:
textVersion
- the text index version number.- Returns:
- this
-
getSphereVersion
public Integer getSphereVersion()
Deprecated.Gets the 2dsphere index version number.- Returns:
- the 2dsphere index version number
-
sphereVersion
public IndexRequest sphereVersion(Integer sphereVersion)
Deprecated.Sets the 2dsphere index version number.- Parameters:
sphereVersion
- the 2dsphere index version number.- Returns:
- this
-
getBits
public Integer getBits()
Deprecated.Gets the number of precision of the stored geohash value of the location data in 2d indexes.- Returns:
- the number of precision of the stored geohash value
-
bits
public IndexRequest bits(Integer bits)
Deprecated.Sets the number of precision of the stored geohash value of the location data in 2d indexes.- Parameters:
bits
- the number of precision of the stored geohash value- Returns:
- this
-
getMin
public Double getMin()
Deprecated.Gets the lower inclusive boundary for the longitude and latitude values for 2d indexes..- Returns:
- the lower inclusive boundary for the longitude and latitude values.
-
min
public IndexRequest min(Double min)
Deprecated.Sets the lower inclusive boundary for the longitude and latitude values for 2d indexes..- Parameters:
min
- the lower inclusive boundary for the longitude and latitude values- Returns:
- this
-
getMax
public Double getMax()
Deprecated.Gets the upper inclusive boundary for the longitude and latitude values for 2d indexes..- Returns:
- the upper inclusive boundary for the longitude and latitude values.
-
max
public IndexRequest max(Double max)
Deprecated.Sets the upper inclusive boundary for the longitude and latitude values for 2d indexes..- Parameters:
max
- the upper inclusive boundary for the longitude and latitude values- Returns:
- this
-
getBucketSize
public Double getBucketSize()
Deprecated.Gets the specified the number of units within which to group the location values for geoHaystack Indexes- Returns:
- the specified the number of units within which to group the location values for geoHaystack Indexes
- MongoDB documentation
- geoHaystack Indexes
-
bucketSize
public IndexRequest bucketSize(Double bucketSize)
Deprecated.Sets the specified the number of units within which to group the location values for geoHaystack Indexes- Parameters:
bucketSize
- the specified the number of units within which to group the location values for geoHaystack Indexes- Returns:
- this
- MongoDB documentation
- geoHaystack Indexes
-
getDropDups
public boolean getDropDups()
Deprecated.Returns the legacy dropDups settingPrior 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.
- Returns:
- the legacy dropDups setting
- MongoDB documentation
- duplicate dropping
-
dropDups
public IndexRequest dropDups(boolean dropDups)
Deprecated.Sets the legacy dropDups settingPrior 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.
- Parameters:
dropDups
- the legacy dropDups setting- Returns:
- this
- MongoDB documentation
- duplicate dropping
-
getStorageEngine
public BsonDocument getStorageEngine()
Deprecated.Gets the storage engine options document for this index.- Returns:
- the storage engine options
- Since server release
- 3.0
-
storageEngine
public IndexRequest storageEngine(BsonDocument storageEngineOptions)
Deprecated.Sets the storage engine options document for this index.- Parameters:
storageEngineOptions
- the storage engine options- Returns:
- this
- Since server release
- 3.0
-
getPartialFilterExpression
public BsonDocument getPartialFilterExpression()
Deprecated.Get the filter expression for the documents to be included in the index or null if not set- Returns:
- the filter expression for the documents to be included in the index or null if not set
- Since:
- 3.2
- MongoDB documentation
- Partial Indexes
- Since server release
- 3.2
-
partialFilterExpression
public IndexRequest partialFilterExpression(BsonDocument partialFilterExpression)
Deprecated.Sets the filter expression for the documents to be included in the index- Parameters:
partialFilterExpression
- the filter expression for the documents to be included in the index- Returns:
- this
- Since:
- 3.2
- MongoDB documentation
- Partial Indexes
- Since server release
- 3.2
-
getCollation
public Collation getCollation()
Deprecated.Returns the collation options- Returns:
- the collation options
- Since:
- 3.4
- Since server release
- 3.4
-
collation
public IndexRequest collation(Collation collation)
Deprecated.Sets the collation optionsA null value represents the server default.
- Parameters:
collation
- the collation options to use- Returns:
- this
- Since:
- 3.4
- Since server release
- 3.4
-
getWildcardProjection
public BsonDocument getWildcardProjection()
Deprecated.Gets the wildcard projection of a wildcard index- Returns:
- the wildcard projection
- Since:
- 3.10
- Since server release
- 4.2
-
wildcardProjection
public IndexRequest wildcardProjection(BsonDocument wildcardProjection)
Deprecated.Sets the wildcard projection of a wildcard index- Parameters:
wildcardProjection
- the wildcard projection- Returns:
- this
- Since:
- 3.10
- Since server release
- 4.2
-
-