ErickTamayo / laravel-scout-elastic

Elastic Driver for Laravel Scout
MIT License
916 stars 242 forks source link

Warning about type deprecation #152

Closed mlambley closed 3 years ago

mlambley commented 3 years ago

I did find some chatter about this in your issue log but I can see that it hasn't been resolved so I'm posting it here.

<warning>PHP Deprecated:  Specifying types in urls has been deprecated in vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Search.php on line 36</warning>

Code which causes this: https://github.com/ErickTamayo/laravel-scout-elastic/blob/004c8fc0088bce96fde90bedca9c43346ce0bd3f/src/Engines/ElasticsearchEngine.php#L126-L130

I have noticed that scout's searchableAs by default includes the table name (link)

    public function searchableAs()
    {
        return config('scout.prefix').$this->getTable();
    }

So I would think that the only breaking change would be to require devs to specify their own searchableAs for models which don't map to a database table? Because otherwise the index would be unique anyway? Unless I'm not understanding the issue here.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mlambley commented 3 years ago

+1?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mlambley commented 3 years ago

Happy July to you too, stalebot.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mlambley commented 3 years ago

It's September already? Greetings once again my good friend stalebot.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ascott-main commented 2 years ago

Good morning!! Hi @mlambley I just see this and I am having the same issue, it looks like the import command with scout work perfectly but when I try to search for something have this issue

<warning>PHP Deprecated:  Specifying types in URLs has been deprecated in /var/www/web/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Search.php on line 36</warning>
Elasticsearch\Common\Exceptions\BadRequest400Exception with message '{"error":"no handler found for uri [//ascott_mdm_seasons/App%5CSeason/_search] and method [POST]"}'

Have you been able to fix this issue? Could you tell me how?

Thanks in advance.

mlambley commented 2 years ago

@ascott-main The fix is to remove 'type' => get_class($builder->model), as described in my OP. I tried to get the repo author's attention over the course of several months. I recommend creating yourself a fork and removing that line of code.

ascott-main commented 2 years ago

@mlambley Thank you very much, I will try with that!!!