[Photon] Deleting all but a single country

Edward Hibbert edward at ehibbert.org.uk
Thu Oct 8 11:17:14 UTC 2020


Thanks for Photon.  It's great.

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.

I came across this:

https://github.com/komoot/photon/issues/175

So I did this:

root at photon:/photon# curl -X POST 
"http://localhost:9200/photon/place/_delete_by_query?pretty" -H 
'Content-Type: application/json' -d' { "query": { "bool": { "must_not": 
{ "match": { "collector.en.raw": { "query": "United Kingdom", 
"operator": "or", "analyzer": "index_raw" } } } } } }'
{
   "_index" : "photon",
   "_type" : "place",
   "_id" : "_delete_by_query",
   "_version" : 3,
   "result" : "updated",
   "_shards" : {
     "total" : 2,
     "successful" : 1,
     "failed" : 0
   },
   "created" : false
}
root at photon:/photon# curl -XPUT 
"http://localhost:9200/photon/_settings?preserve_existing=true" -d '{ 
"index.merge.policy.expunge_deletes_allowed" : "0" }'
{"acknowledged":true}root at photon:/photon#
root at photon:/photon# curl -XPUT 
"http://localhost:9200/photon/_settings?preserve_existing=true" -d '{ 
"index.merge.policy.expunge_deletes_allowed" : "0" }'
{"acknowledged":true}root at photon:/photon#

That all looks successful, but the database size hasn't changed and it 
still finds Berlin.

Is there something else which I should be doing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/photon/attachments/20201008/89a60d74/attachment.htm>


More information about the Photon mailing list