Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Client.php line 353: Endpoint table_name not available #6

Open
iateadonut opened this issue Oct 31, 2020 · 2 comments · May be fixed by #9
Open

In Client.php line 353: Endpoint table_name not available #6

iateadonut opened this issue Oct 31, 2020 · 2 comments · May be fixed by #9

Comments

@iateadonut
Copy link

Detailed description

When I try to "php scout:import Model", I get the error

In Client.php line 353:

Endpoint product_flat not available (product_flat is the $table name)

I can see the "default" core I made at http://127.0.0.1:8983/solr/#/~cores/default .

I've put this into my config/scout.php file

'solr' => [
    'host' => env('SOLR_HOST', '127.0.0.1'),
    'port' => env('SOLR_PORT', '8983'),
    'path' => env('SOLR_PATH', '/solr/'),
    'core' => env('SOLR_CORE', 'default'),
],

and have this in my .env:

SCOUT_QUEUE=false
SCOUT_DRIVER=solr

SOLR_HOST=127.0.0.1
SOLR_PORT=8983
SOLR_PATH=/solr/
SOLR_CORE=default

Your environment

php 7.3, laravel 6.18.20

entire error message:

[2020-10-31 12:55:08] local.ERROR: Endpoint product_flat not available {"exception":"[object] (Solarium\Exception\OutOfBoundsException(code: 0): Endpoint product_flat not available at /var/www/bagisto/vendor/solarium/solarium/src/Core/Client/Client.php:353)
[stacktrace]
#0 /var/www/bagisto/vendor/solarium/solarium/src/Core/Client/Client.php(805): Solarium\Core\Client\Client->getEndpoint('product_flat')
#1 /var/www/bagisto/vendor/solarium/solarium/src/Core/Client/Client.php(782): Solarium\Core\Client\Client->executeRequest(Object(Solarium\Core\Client\Request), 'product_flat')
#2 /var/www/bagisto/vendor/solarium/solarium/src/Core/Client/Client.php(868): Solarium\Core\Client\Client->execute(Object(Solarium\QueryType\Update\Query\Query), 'product_flat')
#3 /var/www/bagisto/vendor/jeroenherczeg/laravel-scout-solr/src/SolrEngine.php(64): Solarium\Core\Client\Client->update(Object(Solarium\QueryType\Update\Query\Query), 'product_flat')
#4 /var/www/bagisto/vendor/laravel/scout/src/Searchable.php(63): ScoutEngines\Solr\SolrEngine->update(Object(Illuminate\Database\Eloquent\Collection))
#5 /var/www/bagisto/vendor/laravel/scout/src/Searchable.php(42): Models\ProductFlat->queueMakeSearchable(Object(Illuminate\Database\Eloquent\Collection))
#6 [internal function]: Illuminate\Database\Eloquent\Collection->Laravel\Scout\{closure}()
#7 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php(111): call_user_func_array(Object(Closure), Array)
#8 /var/www/bagisto/vendor/laravel/scout/src/SearchableScope.php(36): Illuminate\Support\Collection->__call('searchable', Array)
#9 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(103): Laravel\Scout\SearchableScope->Laravel\Scout\{closure}(Object(Illuminate\Database\Eloquent\Collection))
#10 /var/www/bagisto/vendor/laravel/scout/src/SearchableScope.php(39): Illuminate\Database\Eloquent\Builder->chunkById(500, Object(Closure))
#11 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1350): Laravel\Scout\SearchableScope->Laravel\Scout\{closure}(Object(Illuminate\Database\Eloquent\Builder), NULL)
#12 /var/www/bagisto/vendor/laravel/scout/src/Searchable.php(133): Illuminate\Database\Eloquent\Builder->__call('searchable', Array)
#13 /var/www/bagisto/vendor/laravel/scout/src/Console/ImportCommand.php(45): Models\ProductFlat::makeAllSearchable(NULL)
#14 [internal function]: Laravel\Scout\Console\ImportCommand->handle(Object(Illuminate\Events\Dispatcher))
#15 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#16 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Container/Util.php(37): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#17 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#18 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#19 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#20 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call(Array)
#21 /var/www/bagisto/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#22 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#23 /var/www/bagisto/vendor/symfony/console/Application.php(1000): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /var/www/bagisto/vendor/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand(Object(Laravel\Scout\Console\ImportCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /var/www/bagisto/vendor/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /var/www/bagisto/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /var/www/bagisto/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 {main}

@iateadonut
Copy link
Author

This returns "OK":

       $config = ['endpoint' => [ "product_flat" => [
                'host'=>'127.0.0.1',
                'port'=>'8983',
                'path'=>'/solr/',
                'core'=>'default',
            ]]
        ];
        $client = new \Solarium\Client( $config );
        $ping = $client->createPing();

        try {
            $client->ping($ping);
            return response()->json('OK');
        } catch ( \Solarium\Exception\HttpException $e) {
            echo $e->getMessage();
        }

@iateadonut
Copy link
Author

I temporarily "fixed" this in jeroenherczeg/laravel-scout-solr/src/SolrEngine.php(64) by doing:

$this->client->update($query, 'default');

peterzaccha added a commit to peterzaccha/laravel-scout-solr that referenced this issue Jan 8, 2021
@peterzaccha peterzaccha linked a pull request Jan 8, 2021 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant