I tried to use this module with a search of Solr Document data source and got an error:
Error: Call to a member function create() on null in Drupal\search_api_solr\Plugin\search_api\datasource\SolrDocument->loadMultiple() (line 194 of /app/web/modules/contrib/search_api_solr/src/Plugin/search_api/datasource/SolrDocument.php)
#0 /app/web/modules/contrib/search_api/src/Entity/Index.php(879): Drupal\search_api_solr\Plugin\search_api\datasource\SolrDocument->loadMultiple(Array)
#1 /app/web/modules/contrib/search_api_autocomplete/src/Plugin/search_api_autocomplete/suggester/LiveResults.php(328): Drupal\search_api\Entity\Index->loadItemsMultiple(Array)
#2 /app/web/modules/contrib/search_api_autocomplete/src/Controller/AutocompleteController.php(135): Drupal\search_api_autocomplete\Plugin\search_api_autocomplete\suggester\LiveResults->getAutocompleteSuggestions(Object(Drupal\search_api\Query\Query), 'asse', 'asse')
#3 [internal function]: Drupal\search_api_autocomplete\Controller\AutocompleteController->autocomplete(Object(Drupal\search_api_autocomplete\Entity\Search), Object(Symfony\Component\HttpFoundation\Request))
#4 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#5 /app/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#6 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#7 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#8 /app/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#9 /app/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#10 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /app/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /app/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#19 {main}
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | search_api_autocomplete_loadMultiple_11.x_4.patch | 7.26 KB | anweshasinha |
| #2 | 3382533-2.patch | 728 bytes | keshavv |
Comments
Comment #2
keshavv commentedAdded patch.
Comment #3
sershevchykThe last patch applied well but autocomplete doesn't work. Also, I found the warning :
Could not load the following items on index Remote Data: "solr_document/1000740", "solr_document/1000713", "solr_document/1000608", "solr_document/1000634", "solr_document/1000699", "solr_document/1000633", "solr_document/1000548", "solr_document/1000547", "solr_document/1000534", "solr_document/1000530".Comment #4
anweshasinha commentedHi,
I have created patch for the search api autocomplete issue received above. Please review once.
Comment #5
viren18febs commentedComment #6
sershevchykAny of the patches above didn't help with the problem on my project. I have created my own plugin and it helps me with the task, maybe it will be helpful for other developers. But we need to create a patch to this module and search_api.
Comment #7
drunken monkeyThis was a bug in the Solr module and is already fixed, see #3345616: Fix SolrDocument::loadMultiple(). Please just update to the latest version of the Solr module.