Not able to establish link between the attachment and its parent node

Created on 5 December 2024, 4 months ago
Updated 2 February 2025, 2 months ago

Problem/Motivation

Indexing Drupal content, specifically a 'Document' content type that includes a file field. Used Elasticsearch to power the search and display results in a Drupal view.

Successfully indexed the content type fields and can see them in search results. To enhance search capabilities, Integrated Tika to extract text from file attachments.

While I can see the extracted text in Elasticsearch, I'm currently unable to establish a link between the attachment and its parent node. This is preventing me from displaying the node title in search results.

Steps to reproduce

Drupal version used : 10.2.3
Modules
search_api 8.x-1.31
search_api_attachments 9.0.2
Elasticsearch Connector:8.x-7.0-alpha4
Elasticsearch Connector Views :8.x-7.0-alpha4

1. Created a content type "Document" with title, file fields

2. Connect to a Elastic Search Server

3. Add fields for indexing both title and file fields for index and make sure we check the file attachment processors.

4. Set up a tika extractor via search api attachment config page

5. After indexing we could see the index values through elastic view plugin

Not able to display the node title of attachment row in drupal view.

Proposed resolution

I tried to resolve with following was
1. Add a custom view handler for setting relationship for view to link file id, file usage and node table
2. Able to get node relationship in view pre render but not sure about the performance.

Remaining tasks

Not Applicable

User interface changes

Not Applicable

API changes

Not Applicable

Data model changes

Not Applicable

💬 Support request
Status

Active

Version

9.0

Component

Code

Created by

🇮🇳India mathewssunny

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇫🇷France izus

    i think your need here is to make a view to search for nodes of type "Document" not a view based on files .
    and then find results searching keys that are attached to the node type "Document".
    Please see "SIMPLE USAGE EXAMPLE 1" in README file. it has the same case but with article content type. but it looks like what you need.
    hepe it helps

Production build 0.71.5 2024