Undefined 'indexing_options' at EmbeddingBase.php

Created on 23 January 2025, 4 months ago

Problem/Motivation

Server doesnt index correctly metadata.

Steps to reproduce

- Install module https://www.drupal.org/project/ai_vdb_provider_pinecone β†’ as a vdb provider.
- Create AI server. (see images for configuration)
- Create Index for contents, and point to the vdb server.
- Index content
- Check message "Successfully indexed X items."
- Check Pinecone database, you will see that there is no records.

I'm still investigating why I'm having this issue and I know its an experimental module, but I was expecting at least to get my documents indexed.

The point I'm looking at is the line of code that throws this warning:

Warning: Undefined array key "indexing_options" in Drupal\ai_search\Plugin\EmbeddingStrategy\EmbeddingBase->buildBaseMetadata() (line 317 of /var/www/html/web/modules/contrib/ai/modules/ai_search/src/Plugin/EmbeddingStrategy/EmbeddingBase.php)

    $index_config = $this->configFactory->get('ai_search.index.' . $index->id())->getRawData();

apparently this doesnt return anything.

πŸ› Bug report
Status

Active

Version

1.0

Component

AI Search

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @yago elias
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    It seems like you haven't configured Fields in your Search API Index? Please go to the Fields tab and chose Indexing Options; there should be a fair amount of on-page documentation explaining what to do there. Let us know if you get stuck. Thanks

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    This adds a helper warning to the search index status page to indicate whether indexing options have been set.

    Updated issue summary to make it clear how to reproduce (ie, 'Save', not 'Save and add fields' and never use add Fields tab)

  • πŸ‡¬πŸ‡§United Kingdom MrDaleSmith

    Feels like a SAPI issue rather than an AI issue (what would the index do if it was set up without fields?) but code looks good and works so RTBC.

  • It appears that the issue was indeed as mentioned:

    It seems like you haven't configured Fields in your Search API Index?

    I needed to set up that configuration. I didn't pay enough attention, as I assumed that enabling the search recipe would automatically configure an index and a server.


    This is the missing configuration.


    This shows the Pinecone index after rebuilding it.

    My English isn't perfect, so I couldn't find any documentation addressing this specific issue. It’s possible that I simply overlooked it – a classic case of "where did I put my glasses?" But I genuinely believe that it would be beneficial for the Drupal community if the CMS came with the Help module enabled by default. Additionally, creating a help guide there could assist users who aren't experts in coding to better navigate through the Drupal CMS.

    Anyway, thank you all for your support! I'm glad to say that my problem has been resolved.

  • Pipeline finished with Skipped
    3 months ago
    #404731
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Thanks for confirming. Will merge in the branch so you see a big yellow warning instead next time (or future site builders)

    • scott_euser β†’ committed 3fc32cc2 on 3479388-research-normalize-function-with-actions
      Issue #3501821 by scott_euser: Undefined 'indexing_options' at...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024