PHP Class Owl\Services\SearchService

Inheritance: extends Service
Show file Open project: owl/owl

Protected Properties

Property Type Description
$itemFtsRepo
$tagFtsRepo

Public Methods

Method Description
__construct ( Owl\Repositories\ItemFtsRepositoryInterface $itemFtsRepo, Owl\Repositories\TagFtsRepositoryInterface $tagFtsRepo )
itemCreate ( integer $item_id, string $title, text $body ) : Illuminate\Database\Eloquent\Model Create a item fts.
itemDelete ( $item_id ) : boolean Delete a item fts.
itemMatch ( string $str, integer $limit = 10, integer $offset ) : array item match
itemMatchCount ( string $str ) : array item matchCount
tagFirstOrCreateByIdAndWords ( integer $tag_id, string $words ) : Illuminate\Database\Eloquent\Model get a tagFts data or Create a tagFts data by ID and Words.
tagMatch ( $str, integer $limit = 10, integer $offset ) : array get tags data by string for FullTextSearch.

Method Details

__construct() public method

public __construct ( Owl\Repositories\ItemFtsRepositoryInterface $itemFtsRepo, Owl\Repositories\TagFtsRepositoryInterface $tagFtsRepo )
$itemFtsRepo Owl\Repositories\ItemFtsRepositoryInterface
$tagFtsRepo Owl\Repositories\TagFtsRepositoryInterface

itemCreate() public method

Create a item fts.
public itemCreate ( integer $item_id, string $title, text $body ) : Illuminate\Database\Eloquent\Model
$item_id integer
$title string
$body text
return Illuminate\Database\Eloquent\Model

itemDelete() public method

Delete a item fts.
public itemDelete ( $item_id ) : boolean
$item_id int
return boolean

itemMatch() public method

item match
public itemMatch ( string $str, integer $limit = 10, integer $offset ) : array
$str string
$limit integer
$offset integer
return array

itemMatchCount() public method

item matchCount
public itemMatchCount ( string $str ) : array
$str string
return array

tagFirstOrCreateByIdAndWords() public method

get a tagFts data or Create a tagFts data by ID and Words.
public tagFirstOrCreateByIdAndWords ( integer $tag_id, string $words ) : Illuminate\Database\Eloquent\Model
$tag_id integer
$words string
return Illuminate\Database\Eloquent\Model

tagMatch() public method

get tags data by string for FullTextSearch.
public tagMatch ( $str, integer $limit = 10, integer $offset ) : array
$limit integer
$offset integer
return array

Property Details

$itemFtsRepo protected property

protected $itemFtsRepo

$tagFtsRepo protected property

protected $tagFtsRepo