Delete Document from Index


(Kartavya) #1

Hi

I ran delete query on index documents. It reduces the document count from
57309066 to 6167240

But it is very strange my index size 128 GB remains the same. Can anybody
explain this unexpected behavior?

How can reduce index size with deleted documents?

Regards,
Pulkit


(Igor Motov) #2

Lucene doesn't remove deleted documents from the index files right away.
Instead, it marks them as deleted and gets rid of them eventually during
segment merges. You can force this process by running:

curl -XPOST
'http://localhost:9200/your-index/_optimize?only_expunge_deletes=true'

See http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize.html
for more information.

On Monday, July 16, 2012 9:38:55 AM UTC-4, kartavya wrote:

Hi

I ran delete query on index documents. It reduces the document count from
57309066 to 6167240

But it is very strange my index size 128 GB remains the same. Can anybody
explain this unexpected behavior?

How can reduce index size with deleted documents?

Regards,
Pulkit


(Kartavya) #3

Thanks.
It helps.

On Mon, Jul 16, 2012 at 11:54 PM, Igor Motov imotov@gmail.com wrote:

Lucene doesn't remove deleted documents from the index files right away.
Instead, it marks them as deleted and gets rid of them eventually during
segment merges. You can force this process by running:

curl -XPOST '
http://localhost:9200/your-index/_optimize?only_expunge_deletes=true'

See
http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize.htmlfor more information.

On Monday, July 16, 2012 9:38:55 AM UTC-4, kartavya wrote:

Hi

I ran delete query on index documents. It reduces the document count from
57309066 to 6167240

But it is very strange my index size 128 GB remains the same. Can anybody
explain this unexpected behavior?

How can reduce index size with deleted documents?

Regards,
Pulkit


(system) #4