Geo_shape index cannot convert by avro (nifi)

I use json like this:
the "geometry" is a string.
I want to index this json with mapping:

  `  {
    "mappings": {
        "data": {
            "properties": {
                  "type" : "keyword",
                  "index" : false
                "geometry": {
                    "type": "geo_shape"

I used nifi professor and got the error:

It's so hard with avro schema to solve this,pls help me.thank you!

The problem is that your process is taking the generated geoJson and converting it to a string. I don't know much about Avro but you need to find a way so the GeoJSON is not treated as a String, or maybe try to generate WKT?

1 Like

Thank you for reply.I solved my problem with generate WKT.I trans it like:
POLYGON ((95.20724 -68.44105,99.64702 -69.16904,97.65649 -70.76711,92.94828 -69.98763,95.20724 -68.44105))
It work well,and the intersection is well done:
GET /landsat/_search { "query":{ "bool": { "must": { "match_all": {} }, "filter": { "geo_shape": { "geometry": { "shape": { "type": "polygon", "coordinates" : [[[96.0, -69.0],[96.0,-65.0],[97.0,-65.0],[97.0,-69],[96.0,-69.0]]] }, "relation": "INTERSECTS" } } } } } }
It's a good way for me.
Thank you very much for the help!
Have a good day!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.