When creating a new Search API index, you can choose the index "Item type" to be "Multiple types" which enables you to choose ie. both File and Content -types for your index. Currently Metatag seems to support only one selected type and it would be useful to be able to index metadata with "Multiple types" provided that the selected types are compatible.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thatguy created an issue. See original summary.

thatguy’s picture

I tried patching this issue myself but I don't have too much experience on patching so any feedback is welcome! I simply added check for the multiple type selection in the supportsIndex and making sure that atleast one of the selected types is an entity. For the alterItems I needed to add check for the multiple types too and also change a bit the logic since the data structure is different with multiple types. I think the code in this could be a bit better structured so I'll see if I have time to improve it.

thatguy’s picture

Status: Active » Needs review
DamienMcKenna’s picture

Assigned: thatguy » Unassigned
Parent issue: » #2958474: Plan for Metatag 7.x-1.26

Thanks for taking the time to work through this and build a patch, it's appreciated.

FYI the "assigned" option is used to indicate that you're actively working on something, after you upload a patch or finish your work it's suggested to change that option back to "unassigned" so others know you're finished.

DamienMcKenna’s picture

Status: Needs review » Fixed

Looks good, thank you. Committed.

  • DamienMcKenna committed 6fdb2b3 on 7.x-1.x authored by thatguy
    Issue #3018692 by thatguy, DamienMcKenna: Search API index multiple...
DamienMcKenna’s picture

Status: Needs review » Fixed

  • DamienMcKenna committed 274108f on 7.x-1.x authored by thatguy
    Issue #3018692 by thatguy, DamienMcKenna: Search API index multiple...

Status: Fixed » Closed (fixed)

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