elastic icon indicating copy to clipboard operation
elastic copied to clipboard

Create service for Search Template API

Open olivere opened this issue 6 years ago • 8 comments

See the REST API spec, the documentation and e.g. the official .NET client.

olivere avatar Nov 28 '18 18:11 olivere

i was looking for some example of how to implement searchTemplate POST using elastic library. Links in this issue are broken. can u link some document where i can search using template.

prasad-marne avatar Mar 06 '19 08:03 prasad-marne

The latest API specification for 6.x can be found here now.

I guess the latest implemenation for 6.x is this.

olivere avatar Mar 06 '19 11:03 olivere

i would like to implement this service. I am not sure the best practice so can u guide me how should i go about implementing this service?

prasad-marne avatar Mar 07 '19 03:03 prasad-marne

Hi,

We use olivere/elastic and are looking at using _search/template. Therefore, we are interested in this feature. We might also be interested in contributing to this with a PR. Where should we look to find information about how to generate the service?

I found in a comment you made in another issue that you used https://github.com/olivere/elastic/tree/generate-api/generator to generate some code from the api spec.

Thank you.

ghost avatar Jul 08 '20 17:07 ghost

"API Status" marks Search Template as available, this is quite misleading

foxen avatar Jul 17 '20 08:07 foxen

@foxen It's partly implemented. E.g. you should be able to store, get, and delete a template. What is missing is search and render.

olivere avatar Jul 17 '20 09:07 olivere

Hi,

We use olivere/elastic and are looking at using _search/template. Therefore, we are interested in this feature. We might also be interested in contributing to this with a PR. Where should we look to find information about how to generate the service?

I found in a comment you made in another issue that you used https://github.com/olivere/elastic/tree/generate-api/generator to generate some code from the api spec.

Thank you.

@jackdbernier Yes, the code generator was a good starting point. Nowadays, as only few services get added between versions, I will mostly simply take an existing service as a blueprint.

For the implementation part, I always use the Java source as the ultimate truth. The ES documentation is very good and useful, but it's written for humans and is often ambiguous and lacks details you can only find in the source code.

olivere avatar Jul 17 '20 09:07 olivere