UpdateSettings
Templates
Warmers
Stats
Status
Se gments
ClearCache
IndicesExists
Type sExists
Cluster
Health
State
UpdateSettings
NodesInfo
NodesStats
NodesShutdown
NodesHotThreads
Clusterreroute
"message" : "trying out Elastic Search"
}
}'
Au tomati cindexcreationcanbedisabledbysetting action.auto_create_indexto
falseintheconfigfileofallnodes.Automaticmappingcreationcanbedisabledbysetting
index.mapper.dynamicto falseintheconfigfilesofallnodes(oronthespecificindex
settings).
Au tomati cindexcreationcanincludeapatternbasedwhile/blacklist,forexample,set
action.auto_create_indexto +aaa*,-bbb*,+ccc*,-*(+meaningallowed,and–
meaningdisallowed).Note,thisfeatureisavailablesince0.20.
Versioning
Ea chindexeddocumentisgivenaversi onnumber.Theassociated versionnumberis
returnedaspartoftheresponsetotheindexAPIrequest.TheindexAPIoptionallyallows
foroptimisticconcurrencycontrol whenthe versionparameterisspecified.Thiswill
controltheversionofthedocumenttheoperationisintendedtobeexecutedagainst.Agood
exampleofausecaseforversioningisperformingatransactionalreadthenupdate.
Sp ecifying a versionfromthedocumentinitiallyreadensuresnochangeshavehappened
inthemeantime(whenreadingi nordertou pdate,itisrecommendedtoset preferenceto
_primary).Forexample:
curl -XPUT 'localhost:9200/twitter/tweet/1?version=2' -d '{
"message" : "elasticsearch now has versioning support, double cool!"
}'
NOTE:versioningiscompletelyrealtime,andisnotaffectedbythenearrealtimeaspects
ofsearchoperations.Ifnoversionisprovided,thentheoperationisexecutedwithoutany
versionchecks.
Bydefault,internalversioningisusedthatstartsat1andincrementswitheachupdate.
Optionally,theversionnumbercanbesupplementedwithanexternalvalue(forexample,if
maintainedinadataba se).Toenablethisfu nctiona lity, version_typeshouldbesetto
external.Thevalue providedmustbeanumeric,longvaluegreaterthan0,andlessthan
around9.2e+18.Whenusingtheexternalversiontype,insteadofcheckin gfora matching
versionnumber,thesystemcheckstoseeiftheversionn umberpassedtotheindexrequest
isg reaterthantheve rsionofthecurrentlystoreddocument.Iftrue,thedocumentwillbe
indexedandthen ewversionnumberused .Ifthevalueprovidedislessthanorequalto the
storeddocument’sve rsionnumber,ave rsionconflictwilloccurandtheind exoperationwil l
fail.
Ani cesideeffectisthatthereisnoneed tomaintainstrictorderingofasyncindexing
operationsexecutedasaresultofchangestoasourcedatabase ,aslon gasversion
numbersfromthesourcedatabaseareused.Eventhesimplecaseofupdatingthe
elasticsearchindexusingdatafromadatabaseissimplifiedifexternalversioningisused,
asonlythelatestversionwillbeusediftheindexoperationsareoutoforderforwhatever
reason.
OperationType
The indexoperationalsoacceptsan op_typethatcanbeusedtofo rcea create
operation,allowingfor“putifabsent”behavior.When createisused,theindexoperation
willfailifadocumentbythatidalreadyexistsinthein dex.