【发布时间】:2020-05-02 19:54:35
【问题描述】:
我们有一个具有 GeoShape 类型字段的索引。如果我们进行包含此字段的查询,并且该字段丢失,我们会收到错误:
**Type: illegal_state_exception Reason: "Shape with name [34219995] found but missing geometry field"**
有什么方法可以为 geoshape 字段分配默认值,就像在其他类型可能为空的情况下一样?
我们使用的查询是这样的:(使用 NEST api):
filters.Add(fq => fq.Term(t => t.Field(f => f.LocalityId).Value(34219995)) || fq.GeoShape(g => g.Field("locationShape").Relation(GeoShapeRelation.Within).IndexedShape(f => f.Id(34219995).Index("GeoshapesIndex").Path("geometry"))));
如果“GeoshapesIndex”中的字段丢失,我们会收到错误消息。
【问题讨论】:
标签: elasticsearch nest