<?php

namespace Hura8\Components\Product\Model;

use Hura8\Interfaces\iSearch;
use Hura8\System\Model\aSearchBaseModel;

class ProductSearchModel extends aSearchBaseModel implements iSearch
{

    private  $filter_fields = [
        "price"         => "tb_product.price",
        "ranking"       => "tb_product.ranking",
        "status"        => "tb_product.status",
        "brand"         => "tb_product.brand_id",
    ];

    private  $fulltext_fields = [
        "category_keywords" => ["tb_product_category.title", ],
        "product_keywords"  => ["tb_product.sku", "tb_product.title", "tb_product.model", "tb_product.related_keywords"],
    ];


    public function __construct()
    {
        parent::__construct(
            "tb_product",
            $this->fulltext_fields,
            $this->filter_fields
        );
    }

}
