- Issue created by @admirlju
- last update
over 1 year ago 102 pass - @admirlju opened merge request.
- Status changed to Needs review
over 1 year ago 8:11am 1 September 2023 - Status changed to Needs work
over 1 year ago 9:14pm 1 September 2023 - last update
over 1 year ago 102 pass - Status changed to Needs review
over 1 year ago 6:52am 4 September 2023 - last update
over 1 year ago 102 pass - Status changed to RTBC
over 1 year ago 9:10am 4 September 2023 - 🇸🇮Slovenia deaom
The validation is limited only for meili search backend (tested with the db plugin) and it works. So you can not change the machine name of the field to id if the backed is meili, but can change and save if the backend is anything else, so marking it as RTBC.
- Status changed to Needs work
over 1 year ago 6:45pm 4 September 2023 - 🇸🇮Slovenia bcizej
The error below appears when:
- Create an index or edit an index
- Select "- No server -" from server options
- Save the index
- Visit
/admin/config/search/search-api/index/{index_name}/fields
Error: Call to a member function getBackend() on null in search_api_meilisearch_form_search_api_index_fields_alter() (line 34 of modules/contrib/search_api_meilisearch/search_api_meilisearch.module). search_api_meilisearch_form_search_api_index_fields_alter(Array, Object, 'search_api_index_fields') (Line: 562) Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'search_api_index_fields') (Line: 840) Drupal\Core\Form\FormBuilder->prepareForm('search_api_index_fields', Array, Object) (Line: 284) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Also form validation is not enough as the following is possible:
- Detach the index from meilisearch server (either to " - No server - " or other backend types) in the edit index form
- Save and then edit the fields and set the machine name as "id"
- Save and then reattach the index to meilisearch
It should not be possible to have an index attached to meilisearch with an "id" field present. But perhaps we are overcomplicating things and should use
search_api_
prefix (as these are reserved and user is not allowed to set them on any indexes) for primary key such assearch_api_meilisearch_id
orsearch_api_document_id
. With 📌 Remove entity id mapping config Fixed close to finish a full reindex of meilisearch indexes will be required anyway... @bcizej I like the idea you proposed of using
search_api_
prefix. This is probably the most elegant way of fixing this. Will look in to it.- last update
over 1 year ago 102 pass - Status changed to Needs review
over 1 year ago 8:23am 5 September 2023 Changed the logic to what @bcizej suggested, now the primary index id is
search_api_document_id
. Also setting the primary id at index creation prevents an error of multiple id when meilisearch is trying to guess what the primary id is at creation.- last update
over 1 year ago 102 pass -
bcizej →
committed 6a8a22db on 1.0.x authored by
admirlju →
Issue #3384535 by admirlju, bcizej, DeaOm, tgoeg: Remove the possibility...
-
bcizej →
committed 6a8a22db on 1.0.x authored by
admirlju →
- Status changed to Fixed
over 1 year ago 7:33pm 5 September 2023 Automatically closed - issue fixed for 2 weeks with no activity.