Closed imrealashu closed 9 years ago
In this example arise problem:
what field from table1
to add to index if table1
have other fields, besides "value" field?
Therefore for all related fields use indexing for "dynamic fields" (see in readme). For example:
table2
add following option: 'optional_attributes' => true
table2
public function getOptionalAttributesAttribute()
{
return [
'table1_id' => "something",
];
}
For example:
table1 id = 1 (PK) value = 'Something'
table2 id = 2 table1_id = 1 another_field='something else'
After Indexing
table2
result will beid=2 table1_id='something' another_field='something else'