Elasticquent icon indicating copy to clipboard operation
Elasticquent copied to clipboard

No handler found for uri and method [POST] using mappingProperties (with temp fix)

Open CaptainHilly opened this issue 7 years ago • 8 comments

When adding a mappingProperties property to a modal, creating an index would fail with...

No handler found for uri [/items] and method [POST]

Not sure if this is an 5.0 thing but looking at the docs a PUT method is required to build an index.

I have temporarily fixed this by modifying the getMethod method in the Endpoints/Indices/create class to always return PUT. Now able to create an index with custom mapping.

Would be good to get some feedback on what the problem is and if the fix mentioned above is acceptable.

Thanks.

CaptainHilly avatar Nov 10 '16 04:11 CaptainHilly

I just noticed in the elastic/elasticsearch-php repo they have made the same change in this commit - https://github.com/elastic/elasticsearch-php/commit/9c620c20ec4a473926a858b7aa1c22b126b166f7

I can see in composer.json you are requiring <2.2 version of this pacakge. Has anyone tested any later releases of this package with elasticquent? There appears to be quite a number of changes since 2.2 and it would be good to pull the latest version?

Thanks,

CaptainHilly avatar Nov 10 '16 05:11 CaptainHilly

A newer version of elastic/elasticsearch-php has not yet been tested. It is on my 'TODO' list, but I simply have not yet had too much time to dedicate to it.

Feel free to test and make a PR 👍

timgws avatar Nov 10 '16 06:11 timgws

Any news about that issue ?

Fabiencdp avatar Jan 02 '17 13:01 Fabiencdp

Facing issue with createIndex:: no No handler found for uri [/my_custom_index_name] and method [POST]' elasticsearch version 2.1.5 i believe its because of Elasticquent not compatible with newer version of elasticseach. please update.

jampack avatar Feb 22 '17 07:02 jampack

This issue come from the ElasticSearch PHP client. In the ElasticSearch 5.0+, they do not allow create index with POST method. So, their ElasticSearch PHP client reflects to that. Check the code at the tag: https://github.com/elastic/elasticsearch-php/blob/v5.1.3/src/Elasticsearch/Endpoints/Create.php (line 92)

So, the proper way to fix this issue in Elasticquent is just simply change the dependency version of ElasticSearch PHP client to point to the v5.1.3. Yah, but you need to test to ensure Elasticquent run properly with this version. I am going to run a test myself and will let you know

khoatran avatar Mar 25 '17 03:03 khoatran

I'm having the same issue where mappingProperties would cause a no handler error

yaodingyd avatar May 05 '17 12:05 yaodingyd

Came across same issue while creating the initial index. Dont use POST to create an index rather use PUT.

prafulux avatar May 27 '17 12:05 prafulux

Can you please fix this issue @timgws it's been 6 months waiting for an official fix.

chadidi avatar Jan 10 '18 06:01 chadidi