Elasticsearch Index API
μΈλ±μ€λ₯Ό μμ±
, μμ
, μ‘΄μ¬μ¬λΆ
, status
(open/close) μ¬λΆ, shrink
(μ€λ μΆμ), split
(μ€λ νμ₯), refresh
(루μ¬μ flushλ‘ μ΄ μμ
μ΄ μνλμ΄μΌ μΈκ·Έλ¨ΌνΈ νμΌμ΄ μμ±λΌ μλ‘μ΄ docμ΄ κ²μμ΄ κ°λ₯ν΄μ§λ€. 컀λμμ μμ€ν
μΊμμ νμΌλ§ μμ±/μ£ΌκΈ°μ μΌλ‘ μλ νΈμΆ λλ€.), flush
(루μ¬μ commitμΌλ‘ dixcμ μμμ±μΌλ‘ μ μ₯μΈλλ λ¨κ³) , forcemerrge
(루μ¬μ mergeλ‘ μ¬λ¬κ°μ μΈκ·Έλ¨ΌνΈλ₯Ό ν©μΉλ μμ
μΌλ‘ memory,diskλ±μ μ μ½νκ³ μΈλ±μ±μ μλ‘ μ΅μ ννμ¬ μν), rollover
(active indexκ° μ€λλ¬κ±°λ ν¬κΈ°κ° 컀벼 λΉ μΈλ±μ€λ₯Ό λ§λ€κ³ κ΅μ²΄κ° νμν λ μ¬μ©)
GetIndex
clientμ indexμ μ 보λ₯Ό client.indices().get()μ ν΅ν΄ μ‘°νν μ μμΌλ©° μ΄λ 첫λ²μ§Έ μΈμλ‘ GetIndexRequest()λ₯Ό ν΅ν΄ νΉμ indexλ₯Ό 리μ ν μ μκ³ *
μ μ£Όμ΄μ§λ©΄ λͺ¨λ indexλ₯Ό μ‘°ννλ€. (/_cat/indices μ λμΌ)
GetIndexResponse
λ΄λΆ νλλ‘ mappings
,aliases
,settings
,defaultSettings
,dataStreams
,indices
κ° μ‘΄μ¬νκ³ getterλ₯Ό ν΅ν΄ μ‘°νκ° κ°λ₯νλ€.
1. settings
indexλ€μ id, μμ±μΌμ, analyzerλ±κ³Ό κ°μ μΈν μ λ³΄κ° Mapμ ννλ‘ ν¬ν¨λκΈ° λλ¬Έμ getSettings()μμ get()μ μ΄μ€μΌλ‘ μ¬μ©νμ¬ κ°μ μ‘°ννκ±°λ getSetting()λ©μλλ₯Ό μ΄μ©ν΄μ μΈν μ 보λ₯Ό μ‘°νν μ μλ€.
2. indices
μ‘°νν indexλ€μ μ΄λ¦λ€μ String[]ννλ‘ ν¬ν¨νκ³ μλ νλ
3. aliases
response.getAliases()
indexμ λ³μΉλ€μ μ 보λ₯Ό μ μ₯νκ³ μλ νλλ‘ /_cat/aliases
λ₯Ό μ΄μ©νμ¬ μ‘°ννκ²κ³Ό λΉμ·νλ€. μ΄λ Mapννλ‘ μ μ₯μ νκ³ μμΌλ©° keyλ‘λ indexλͺ
, valueλ‘λ aliasesμ λ©νμ 보νλ list κ° λ€μ΄μλ€.
+) /_cat/indices
μμ λͺ
λ Ήμ΄λ ?v
λ₯Ό μΆκ°ν΄ columnμ ν¬ν¨ν΄ μ 보λ₯Ό μ‘°ννκ³ μΆλ€λ©΄ lowClientλ₯Ό μ΄μ©ν΄ μ‘°νν μλ μλ€.
μλ΅μ΄ λ¬Έμμ΄λ‘ μμ κ°μ΄ μ€κΈ° λλ¬Έμ jsonννμ λ΅μ μνλ©΄ λ³λλ‘ νμ±μ νμ¬ μ¬μ©νκ±°λ EntityUtilsμ΄ μλ getContent()λ©μλλ₯Ό μ΄μ©ν΄μ InputStreamμΌλ‘ ν μ€ μ© μ½μ΄ νμ±ν΄μ μ¬μ©κ°λ₯νλ€.
Last updated