mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Made search more efficient and tweaked weighting
Added per-entity weighting changes. Now Books score higher than chapters which score higher than pages. Reduced queries required on search by only searching once but at a higher count to see if there's another page.
This commit is contained in:
@ -5,8 +5,16 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
class Entity extends Ownable
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string - Name of property where the main text content is found
|
||||
*/
|
||||
public $textField = 'description';
|
||||
|
||||
/**
|
||||
* @var float - Multiplier for search indexing.
|
||||
*/
|
||||
public $searchFactor = 1.0;
|
||||
|
||||
/**
|
||||
* Compares this entity to another given entity.
|
||||
* Matches by comparing class and id.
|
||||
@ -193,4 +201,5 @@ class Entity extends Ownable
|
||||
{
|
||||
return '/';
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user