Elasticsearch geo_point搜索异常

时间:2014-06-20 13:11:12

标签: php elasticsearch

我的映射中的geo_point过滤器有点问题。

映射: offer: ... mapping: ... location: type: nested include_in_parent: true properties: city: type: string analyzer: my_analyzer boost: 0.5 include_in_all: true region: type: string analyzer: my_analyzer boost: 0.3 include_in_all: false geo: type: geo_point lat_lon: true boost: 0 include_in_all: false

执行此代码时:

        $filter = new Filter\BoolOr();

        $geo = new Filter\Nested();
        $geo->setPath('offer.location');
        $geo->setFilter(
            new Filter\GeoDistance('location.geo', array(
                'lat' => $city->getLatitude(),
                'lon' => $city->getLongitude()
            ), sprintf('%dkm', $distance))
        );
        $filter->addFilter($geo);

我得到了这个例子:

  

嵌套:QueryParsingException [[index]无法找到geo_point字段[location.geo]];

0 个答案:

没有答案