Topics

Tribe Support

Tribe Support's Topics

Scott Crawford

Scott Crawford

March 13 2017

Custom entity fields

If a custom table is included within the domain model of a custom node type, are the additional fields included in global searches?Related, are there best practices when deciding what type(s) of data to index in designing the custom table fields?
Rastin Mehr
Rastin Mehr
March 13 2017 Permalink
Maybe, I haven't tried it. Feel free to experiment
Unkown Person liked this
Scott Crawford
Scott Crawford
March 14 2017 Permalink
How about the indexing... are there certain data types the framework is expecting to be indexed?
Rastin Mehr
Rastin Mehr
March 15 2017 Permalink
Fields that are used for joining tables such as node_id need to be indexed. If you are building a filter feature with a custom query for it, then you can index those fields too. For example username and email fields are also indexed in the people_people table.
Unkown Person liked this
Scott Crawford
Scott Crawford
March 15 2017 Permalink
I noticed in the com_subscriptions coupon entity definition a property being assigned called 'searchable_properties' in the initialize function:

'searchable_properties' => array('code')

I tried adding something similar to a category field I've added to a custom node type and saw no effect... for example after adding "gnome" as a category for a node and then trying a front-end search for "gnome" did not return the node to which this was added.

Where would 'searchable_properties' come into play?
Rastin Mehr
Rastin Mehr
March 16 2017 Permalink
That determines what fields gets included when you filter the results. They don't get included in the global search. The global search only searches the name and body of the nodes: https://github.com/anahitasocial/anahita/blob/master/src/components/com_search/domains/queries/node.php#L97
Scott Crawford
Scott Crawford
March 16 2017 Permalink
OK that makes sense; I can see where that can be very useful.
Rastin Mehr
Rastin Mehr
March 16 2017 Permalink
Yes the domain models don't magically plug into the search component. The search component is an app itself.
Rastin Mehr
Rastin Mehr
March 16 2017 Permalink
If your custom component (or plugin) manages to extend the search component query using a behavior then you can include additional fields to the global search. I haven't tried it yet, but in theory it should work.
Unkown Person liked this

Powered by Anahita