Closed visualight closed 6 years ago
For indexing of data from other tables, you should use indexing for optional fields (see https://github.com/nqxcode/laravel-lucene-search#indexing-of-dynamic-fields). For example,
1) in config for product model add option: 'optional_attributes' => true
2) in product model add accessor like this:
public function getOptionalAttributesAttribute()
{
$typesAttributes = [];
foreach($this->types as $type) {
$typesAttributes["type_{$type->id}"] = $type->name;
}
return $typesAttributes;
}
I use the version 2.2.* of Lucene Search. Some tables of my database have data in another table.
Thank you