Problem/Motivation

I have content with table field. I need to perform a search in the table, but it is impossible to index the tablfield value with Search API module.

Environment:

  • Modules: Search API, Search API Solr, Tablefield
  • Configured Solr Server and Default index
  • Content type with tablefield

I can't index the table field from the Default Index configuration page, because there is no tablefield property that can be indexed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nikolabintev created an issue. See original summary.

nikolabintev’s picture

Here is my patch that allows to index the data in the table field. I've created a table_value property that can be indexed. Also I've created a getter callback tablefield_get_table_value that implodes all the table cells data in one string.

nikolabintev’s picture

Status: Active » Needs review
nikolabintev’s picture

Title: The table's content can't be indexed » The table's content can't be indexed with Search API
jenlampton’s picture

nikolabintev’s picture

Priority: Normal » Major
jenlampton’s picture

Priority: Major » Normal

@nikolabintev any particular reason for the bump from normal to major?

jenlampton’s picture

This still needs a review, so sadly won't be making it into the next release. @nikolabintev if you could find someone to test it out for us I'd love to see it get in soon!

lolandese’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
1.46 KB
66.93 KB

Rerolled patch against latest dev. Tried with solr server.

As opposed to before applying the patch the table field can now be selected to be indexed at admin/config/search/search_api/index/[sample_index]/fields:

Screenshot

lolandese’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

lolandese’s picture

Version: 7.x-2.x-dev » 8.x-2.x-dev
Status: Closed (fixed) » Patch (to be ported)
Eric_A’s picture

Assigned: Unassigned » Eric_A
Eric_A’s picture

Assigned: Eric_A » Unassigned
FileSize
1.81 KB

Here's a forward port. Anyone able to test or review?

Eric_A’s picture

Status: Patch (to be ported) » Needs review
rolfmeijer’s picture

Yes, the patch works.

lolandese’s picture

Status: Needs review » Reviewed & tested by the community

Changing status based on #18.

efrainh’s picture

I confirm #16 is working, i tested with the same environment described above, i got a new item when adding a new field to the search index, it appears as "Stringified table value (field_table:table_value)", I added it as FullText, and now after reindexing i can find the content of the tables when searching on my site.

Thanks Eric_A.

  • Liam Morland committed 1c67b0d on 8.x-2.x authored by Eric_A
    Issue #2746421 by lolandese, Eric_A, efrainh, rolfmeijer: The table's...
Liam Morland’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

lolandese’s picture

For clarification adding a screenshot from /admin/config/search/search-api/index/default_index/fields:

Screenshot