Indexing a Circle (geoshape) Using NEST

Is there anyway of Indexing a Circle i.e. just have the lat/lng and a radius without first having to create a geojson polygon that represents it. i.e. just using its center lat/lng and its radius.

Circles need to be indexed as polygons.
But you can use the Circle processor | Elasticsearch Guide [8.1] | Elastic to make your life easier.

Thanks for your response.
Are there any examples using NEST api when indexing a whole document that has such a field?

No idea.

But from Nest it should be just a normal Index operation with a pipeline.

For example this is how we index a document in NEST:

var result = await ElasticSearchConfig.GetClient().IndexAsync(loc, idx => idx.Index("localities"));;

Where does the processor come into play. We just cannot figure out how to use it? Any chance of one of your NEST guys having a look at this? Thanks.

I believe you could use.

.Pipeline("Pipeline name")

Found that from Indexing documents | Elasticsearch .NET Client [8.1] | Elastic

But we are only indexing a single document and we want to generate the polygon from a circles's center and radius. In the above indexing code which I wrote, is there anyway to achieve this? Thanks

Did you try to define an ingest pipeline and call it at index time as I explained?

Hi. Yes thanks for the tip. We created an ingest pipeline as you said.
However, we cannot figure out how the Cicle processor creates the circle as there is no parameters we can pass for the radius or the center of the circle.

Hi. I think we finally got it.
Thanks you very much.

Great. Adding this piece of code from the documentation so future readers will have it:

PUT circles/_doc/1?pipeline=polygonize_circles
  "circle": "CIRCLE (30 10 40)"

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