Document Search API token field processor

Created on 12 January 2024, 11 months ago
Updated 20 February 2024, 9 months ago

Problem/Motivation

Search API token field processor Fixed was added in Search API 1.30 which is great.

But I am not sure how to make it work ... The Search API Field Token module page says:

Configuration

  1. Navigate to Administration > Extend and enable the module.
  2. Navigate to Administration > Configuration > Search and Metadata > Search API > [Search Index to edit] > Fields.
  3. Add the token fields.
  4. Click update and save.

At the step "Add the token fields.", I am not sure what to do ... Do I need to add a "Custom value (custom_value)" field?

Perhaps someone can clarify, and we can add a page under the https://www.drupal.org/project/search_api documentation.

Steps to reproduce

Proposed resolution

Remaining tasks

📌 Task
Status

Fixed

Version

1.0

Component

Documentation

Created by

🇩🇰Denmark ressa Copenhagen

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

Comments & Activities

  • Issue created by @ressa
  • 🇦🇹Austria drunken monkey Vienna, Austria

    Do I need to add a "Custom value (custom_value)" field?

    Yes, exactly.

  • Status changed to Needs review 10 months ago
  • 🇩🇰Denmark ressa Copenhagen

    Thanks for confirming. I just tried the feature, and it works really well.

    After you click the "Custom value (custom_value)" button on the index page, this is the help text under the field:

    Use this field to set the data to be sent to the index. You can use replacement tokens depending on the type of item being indexed.

    Perhaps we can give a hint where to find the tokens, maybe by adding this sentence?

    You can install the Tokens module and see available tokens under /admin/help/token

    This would be quite helpful for inexperienced users.

    I created a page in the documentation, and added a link under "Proposed resolution" in the Issue Summary.
    Perhaps you can review it, and add it to the menu?

    Feel free to add extra text about other methods to use this field (apart from using tokens) since I am not sure how that can be done.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & sqlite-3.34
    last update 10 months ago
    545 pass
  • 🇦🇹Austria drunken monkey Vienna, Austria

    I’ve added your tutorial to the documentation, thanks!

    Linking to /admin/help/token is also a good idea. However, that page is actually only available if you have both Token and Help installed. The attached patch adds a link in that case. Otherwise, do you know of any documentation page explaining the Token concept in general, as used in Core?

  • Status changed to RTBC 10 months ago
  • 🇩🇰Denmark ressa Copenhagen

    Thanks! The help text with link to Token help page in your patch works perfectly, and is only shown when both Help and Token modules are installed.

    There is https://www.drupal.org/documentation/modules/token and sub-pages for Drupal 7, but the differences are probably too big to use in Drupal 10, and an updated version required.

  • Status changed to Fixed 10 months ago
  • 🇦🇹Austria drunken monkey Vienna, Austria

    Good to hear, thanks!
    Merged. Thanks again!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024