Make status available to Search Api

Created on 17 January 2024, 12 months ago
Updated 22 February 2024, 11 months ago

The status is not currently available in Search Api fields. It would be great if this is integrated.

Feature request
Status

Active

Version

1.0

Component

Integration

Created by

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

Comments & Activities

  • Issue created by @mellowtothemax
  • 🇳🇱Netherlands johnv

    Please be more specific.

    - there is the field with items
    - there is a status formatter, which is like a computed field
    - there is a status Views Filter, which uses $items->isOpen() function

    A search_api processor can be added as-is, or a second field with only the computed open/closed status can be created (which would then automatically be available for search_api, i presume).

  • Apologies for the late reply.

    Only these options are available in Search API "Add fields to index"

    (-) Office Hours (field_office_hours)

    • All day (field_office_hours:all_day)
    • Comment (field_office_hours:comment)
    • From (field_office_hours:starthours)
    • To (field_office_hours:endhours)

    Weekday (field_office_hours:day)

    There is no status field and as such cannot index whether the content type is Open or Closed which would be a useful facet.

    Also noticed that in the Skipped fields section

    The following fields cannot be indexed since there is no type mapping for them:

    Office Hours (type "field_item:office_hours")

    Not sure if this is related.

  • 🇳🇱Netherlands johnv

    Problem is that the open/closed status, or isOpen() is a programmed field. So it changes over time, without changing the entity itself.
    I Tried to add such a field properly (without having Search API in mind, but Views), but did not succeed.
    I did create a OfficeHoursStatusFilter.php for Views.

Production build 0.71.5 2024