<html><head>
<style id="css_styles">
blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }
blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }
a img { border: 0px; }
li[style='text-align: center;'], li[style='text-align: center; '], li[style='text-align: right;'], li[style='text-align: right; '] { list-style-position: inside;}
body { font-family: Segoe UI; font-size: 12pt; }
.quote { margin-left: 1em; margin-right: 1em; border-left: 5px #ebebeb solid; padding-left: 0.3em; }
</style>
</head>
<body>Thanks for Photon. It's great.<div><span><br /></span></div><div><span>I'd like to shrink the 130GB database down to just the UK (England, Scotland, Wales, Northern Ireland). This is in no way related to current political events.</span></div><div><span><br /></span></div><div><span>I came across this:</span></div><div><span><br /></span></div><div><a href="https://github.com/komoot/photon/issues/175">https://github.com/komoot/photon/issues/175</a><span><br /></span></div><div><br /></div><div>So I did this:</div><div><br /></div><div>root@photon:/photon# curl -X POST "<a href="http://localhost:9200/photon/place/_delete_by_query?pretty">http://localhost:9200/photon/place/_delete_by_query?pretty</a>" -H 'Content-Type: application/json' -d' { "query": { "bool": { "must_not": { "match": { "collector.en.raw": { "query": "United Kingdom", "operator": "or", "analyzer": "index_raw" } } } } } }'<br />{<br /> "_index" : "photon",<br /> "_type" : "place",<br /> "_id" : "_delete_by_query",<br /> "_version" : 3,<br /> "result" : "updated",<br /> "_shards" : {<br /> "total" : 2,<br /> "successful" : 1,<br /> "failed" : 0<br /> },<br /> "created" : false<br />}<br />root@photon:/photon# curl -XPUT "<a href="http://localhost:9200/photon/_settings?preserve_existing=true">http://localhost:9200/photon/_settings?preserve_existing=true</a>" -d '{ "index.merge.policy.expunge_deletes_allowed" : "0" }'<br />{"acknowledged":true}root@photon:/photon#<br />root@photon:/photon# curl -XPUT "<a href="http://localhost:9200/photon/_settings?preserve_existing=true">http://localhost:9200/photon/_settings?preserve_existing=true</a>" -d '{ "index.merge.policy.expunge_deletes_allowed" : "0" }'<br />{"acknowledged":true}root@photon:/photon#<br /></div><div><br /></div><div>That all looks successful, but the database size hasn't changed and it still finds Berlin. </div><div><br /></div><div>Is there something else which I should be doing?</div></body></html>