I've been tearing my hair out for a couple of days now trying to sort out an issue between the Bean module and Search API. I need to index Beans with their Type as one of the indexed fields, but every time I try and add Type from 'Related Fields', the field wouldn't show up in the Search API index interface.
I managed to find out why - Type is of data type 'bean_type' but no such data type exists, and Search API therefore doesn't recognise it. 'bean_type' is not defined or built on in the Bean module as a data type or an entity type, and is only defined as a piece of meta information in the BeanMetadataController. I would argue this separate data type doesn't need to exist as it is a stereotypical token field. For example, a (Content) Type field on a node is of type token.
Therefore I've changed the field to a token field in the file that governs entityPropertyInfo of a Bean, and on preliminary tests everything is working as expected - and the integration with Search API seems to work great! But as I have not got a broad range of tests for this and I am not a contributor of the module, I don't know if this will have knock-on effects with anything else unforeseen.
Submitted the patch for your approval :)
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | bean-token-as-type-entity-property-2338913-6-D7.patch | 529 bytes | steve.stotter |
Comments
Comment #1
steve.stotter commentedChanged to 'Needs Review' as provided the patch above.
Comment #3
steve.stotter commentedAh that patch was for 7.x-1.7, updated now for 7.x-1.8.
Comment #4
steve.stotter commentedAnd status again.
Comment #6
steve.stotter commentedRe-rolling patch. My git spat out absolute paths rather than relative (hopefully fixed now otherwise I give up...).
Comment #7
indytechcook commentedThanks! Sorry for the trouble! https://www.drupal.org/commitlog/commit/22232/4f7499087b910ecd531520efa0...