我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用elasticsearch_dsl.GeoPoint()。
def test_prepare_ignore_dsl_base_field(self): class CarDocumentDSlBaseField(DocType): position = GeoPoint() class Meta: model = Car index = 'car_index' fields = ['name', 'price'] car = Car(name="Type 57", price=5400000.0, not_indexed="not_indexex") doc = CarDocumentDSlBaseField() prepared_data = doc.prepare(car) self.assertEqual( prepared_data, { 'name': car.name, 'price': car.price } )