Clarify Content access Search API processor compatibility with VDB search backends
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3562211. --> Reported by: [balazswmann](https://www.drupal.org/user/2204810) Related to !1039 !12 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When enabled, the <em>Content access</em> Search API processor automatically adds Node access information to indexed items when applicable (for node and comment entities). It seems that this information (node access records) is not passed over to the vector databases during indexing. This always results an empty result set for those users who don't have any entity access related bypass permissions.</p> <p>So far I did some testing with <a href="https://www.drupal.org/project/ai_vdb_provider_milvus">Milvus VDB Provider</a> and <a href="https://www.drupal.org/project/ai_provider_amazeeio">amazee.ai AI Provider</a> (which is also a VDB provider) and I was able to reproduce this issue in both cases. But I think this is rather an issue for the AI Search module as VDB provider modules are built on that.</p> <p>I also noticed that <a href="https://git.drupalcode.org/project/ai/-/blob/1.2.x/modules/ai_search/src/Plugin/search_api/backend/SearchApiAiSearchBackend.php?ref_type=heads#L561">SearchApiAiSearchBackend::doSearch()</a> always checks entity access regardless of the enabled processors, but if node access data could be indexed by the vector database that would further optimize the entity access check because irrelevant nodes would be filtered out in query phase.</p> <p>As I see this issue affects the <a href="https://git.drupalcode.org/project/ai/-/blob/1.3.x/modules/ai_search/src/Plugin/search_api/backend/SearchApiAiSearchBackend.php?ref_type=heads">1.3.x-dev</a> version as well, but I'm not sure what are the plans regarding this.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. Set up a Search API server with AI Search backend and a VDB provider.<br> 2. Ensure that the <em>Content access</em> Search API processor is enabled for the VBD search index.<br> 3. Set up a chatbot assistant for authenticated users with enabled RAG action and select the appropriate VDB search index.<br> 4. Create a published node and grant authenticated users the View published content permission.<br> 5. Index the published test node with the VDB index.<br> 6. Using a regular authenticated user (who does not have admin or node access bypass permissions) ask the chatbot about the test node.<br> 7. Notice that the chatbot cannot provide an answer and it does not find information about the test node even though the user has view access to the node otherwise.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>I'm not sure whether this is a missing feature which is planned to be fixed in the future or it's not supported on purpose but in either case <a href="https://git.drupalcode.org/project/ai/-/blob/1.2.4/modules/ai_search/src/Plugin/search_api/backend/SearchApiAiSearchBackend.php">SearchApiAiSearchBackend</a> should at least add the Content access processor <a href="https://git.drupalcode.org/project/ai/-/blob/1.2.x/modules/ai_search/src/Plugin/search_api/backend/SearchApiAiSearchBackend.php?ref_type=heads#L127">to the discouraged processor list</a>.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
issue