elasticsearch Geo Polygon Query work not correctly

343 views Asked by At

use this query, I got a wrong result; I don not know why, the picture is the point in map ;

the points in map

below is the query code:

{'sort': [{'createdat': {'order': 'desc'}}], 'query': {'bool': {'filter': {'geo_polygon': {'location': {'points': [{u'lat': u'34.98247152540836', u'lon': u'135.71651458740234'}, {u'lat': u'34.97740808105859', u'lon': u'135.7134246826172'}, {u'lat': u'34.97487624147657', u'lon': u'135.71273803710938'}, {u'lat': u'34.96840562918467', u'lon': u'135.71170806884766'}, {u'lat': u'34.96249723244915', u'lon': u'135.71136474609375'}, {u'lat': u'34.95630702651396', u'lon': u'135.71136474609375'}, {u'lat': u'34.95152336531867', u'lon': u'135.71136474609375'}, {u'lat': u'34.94786508309557', u'lon': u'135.71170806884766'}, {u'lat': u'34.94533233054342', u'lon': u'135.71239471435547'}, {u'lat': u'34.94251806927988', u'lon': u'135.7134246826172'}, {u'lat': u'34.939422270331754', u'lon': u'135.71548461914062'}, {u'lat': u'34.93688925699426', u'lon': u'135.71788787841797'}, {u'lat': u'34.93435616542664', u'lon': u'135.7199478149414'}, {u'lat': u'34.93294885853134', u'lon': u'135.72235107421875'}, {u'lat': u'34.93154152749214', u'lon': u'135.72509765625'}, {u'lat': u'34.929289747611236', u'lon': u'135.73162078857422'}, {u'lat': u'34.928726792983845', u'lon': u'135.7357406616211'}, {u'lat': u'34.92816383449364', u'lon': u'135.73917388916016'}, {u'lat': u'34.92816383449364', u'lon': u'135.74363708496094'}, {u'lat': u'34.928445314221605', u'lon': u'135.7477569580078'}, {u'lat': u'34.9290082707804', u'lon': u'135.7518768310547'}, {u'lat': u'34.93013417230951', u'lon': u'135.75462341308594'}, {u'lat': u'34.93182299563147', u'lon': u'135.758056640625'}, {u'lat': u'34.93632635451754', u'lon': u'135.76595306396484'}, {u'lat': u'34.938577941244965', u'lon': u'135.77041625976562'}, {u'lat': u'34.941392337729816', u'lon': u'135.7745361328125'}, {u'lat': u'34.94364378537599', u'lon': u'135.77831268310547'}, {u'lat': u'34.94645800800363', u'lon': u'135.78105926513672'}, {u'lat': u'34.9495535413299', u'lon': u'135.78346252441406'}, {u'lat': u'34.9520861634788', u'lon': u'135.7858657836914'}, {u'lat': u'34.954618707382416', u'lon': u'135.78792572021484'}, {u'lat': u'34.9574325532808', u'lon': u'135.78929901123047'}, {u'lat': u'34.959683560443565', u'lon': u'135.78998565673828'}, {u'lat': u'34.96165314099156', u'lon': u'135.791015625'}, {u'lat': u'34.9636226742002', u'lon': u'135.7913589477539'}, {u'lat': u'34.96474810049312', u'lon': u'135.7917022705078'}, {u'lat': u'34.96643621094802', u'lon': u'135.7917022705078'}, {u'lat': u'34.96868697078232', u'lon': u'135.7917022705078'}, {u'lat': u'34.970937668780046', u'lon': u'135.7917022705078'}, {u'lat': u'34.98106504449502', u'lon': u'135.78826904296875'}, {u'lat': u'34.98725337980076', u'lon': u'135.78140258789062'}, {u'lat': u'34.987815932544024', u'lon': u'135.780029296875'}, {u'lat': u'34.988097207466', u'lon': u'135.77899932861328'}, {u'lat': u'34.98837848142154', u'lon': u'135.77831268310547'}, {u'lat': u'34.98865975441065', u'lon': u'135.77762603759766'}, {u'lat': u'34.98894102643331', u'lon': u'135.77693939208984'}, {u'lat': u'34.98922229748953', u'lon': u'135.77590942382812'}, {u'lat': u'34.989503567579305', u'lon': u'135.7741928100586'}, {u'lat': u'34.990347372049875', u'lon': u'135.77041625976562'}, {u'lat': u'34.99062863827382', u'lon': u'135.76904296875'}, {u'lat': u'34.9909099035313', u'lon': u'135.76801300048828'}, {u'lat': u'34.991191167822315', u'lon': u'135.76732635498047'}, {u'lat': u'34.991191167822315', u'lon': u'135.76698303222656'}, {u'lat': u'34.991191167822315', u'lon': u'135.76629638671875'}, {u'lat': u'34.99147243114684', u'lon': u'135.76595306396484'}, {u'lat': u'34.99147243114684', u'lon': u'135.76526641845703'}, {u'lat': u'34.99147243114684', u'lon': u'135.76492309570312'}, {u'lat': u'34.99147243114684', u'lon': u'135.76492309570312'}, {u'lat': u'34.99175369350488', u'lon': u'135.76492309570312'}, {u'lat': u'34.98247152540836', u'lon': u'135.71651458740234'}]}}}, 'should': [{'term': {'houseType': u'\u4e2d\u53e4\u72ec\u5e62\u697c\u623f'}}], 'must': [{'term': {'secondRegion': u'\u4eac\u90fd\u5e9c'}}]}}, 'size': 100}
0

There are 0 answers