whosonfirst/py-mapzen-whosonfirst-search

Why are certain placetype IDs not being indexed?

Closed this issue · 0 comments

For example:

{u'_shards': {u'failed': 0, u'successful': 5, u'total': 5},
 u'hits': {u'hits': [], u'max_score': None, u'total': 0},
 u'timed_out': False,
 u'took': 1}

Versus:


echo '{"query": {"term": {"wof:placetype_id": "102312319"}}}' | ./scripts/wof-es-rawquery --host 172.31.15.6 --query -
{u'_shards': {u'failed': 0, u'successful': 5, u'total': 5},
...
                      u'_type': u'neighbourhood'}],
           u'max_score': 5.5383,
           u'total': 49906},
 u'timed_out': False,
 u'took': 2}

But this:


scripts/wof-es-prepare /usr/local/mapzen/whosonfirst-data/data/404/529/181/404529181.geojson 
{'body': {u'edtf:cessation': u'u',
          u'edtf:inception': u'u',
          u'geom:area': 4.7019021771536345,
          u'geom:bbox': u'-74.708664,45.004101,-64.51957,50.320107',
          u'geom:latitude': 49.034007,
          u'geom:longitude': -67.315139,
          u'lbl:lat': u'49.7107441924',
          u'lbl:lon': u'-66.2057768601',
          u'ne:changed': u'Version 1.4',
          u'ne:featurecla': u'channel',
          u'ne:name': u'St. Lawrence River',
          u'ne:name_fr': u'Saint-Laurent',
          u'ne:namealt': u'',
          u'ne:note': u'',
          u'ne:scalerank': u'6.0',
          u'src:geom': u'naturalearth',
          u'wof:belongsto': [],
          u'wof:breaches': [],
          u'wof:country': u'',
          u'wof:geomhash': u'a7ff5540c3431c6d01db7a612c53d90c',
          u'wof:hierarchy': [],
          u'wof:id': 404529181,
          u'wof:lastmodified': 1445550498,
          u'wof:name': u'St. Lawrence River',
          u'wof:parent_id': u'-1',
          u'wof:placetype': u'marinearea',
          'wof:placetype_id': 404528655, <-- PLACETYPE ID
          'wof:placetype_names': [],
          u'wof:superseded_by': [],
          u'wof:supersedes': [],
          u'wof:tags': []},
 'doc_type': u'marinearea',
 'id': 404529181,
 'index': 'whosonfirst'}

All of which feels like some kind of annoying internal "mapping/type" thing which is weird since 404528653 < 2^32...

The problem manifests itself in the spelunker when searching for oceans, marineareas, etc. and has been temporarily patched by searching by wof:placetype and not wof:placetype_id. I hate computers...