teamtnt / laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch
MIT License
1.1k stars 144 forks source link

Scoring results? #155

Closed MadMikeyB closed 6 years ago

MadMikeyB commented 6 years ago

If I have a title and a description in my toSearchableArray method, how do I prioritize the title over the description?

    /**
     * Get the indexable data array for the model.
     *
     * @return array
     */
    public function toSearchableArray()
    {
        $array = [
            'id' => $this->id,
            'title' => $this->title,
            'description' => $this->description
        ];

        return $array;
    }
nticaric commented 6 years ago

Currently you can't, because TNTSearch is field agnostic

MadMikeyB commented 6 years ago

Thanks for the reply @nticaric