Comments (5)
@SamHz 在模型中引入 Searchable Trait
参考说明: 用法
from laravel-scout-tntsearch.
我是跟着这里 做的
这个public $asYouType = true;
是什么意思?能不能说明一下,谢谢
上面那个连接与你发给我的有出入,所以弄不清楚按那个。
`<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;
class Post extends Model
{
use Searchable;
/**
* Get the indexable data array for the model.
*
* @return array
*/
public function toSearchableArray()
{
return $this->only('id', 'title', 'content');
}
}`
from laravel-scout-tntsearch.
@SamHz
$asYouType 翻译过来就是 "当你输入时",也就是我们常说的实时搜索,跟你平时使用搜索引擎一样,每输入一个字都会返回搜索结果。
from laravel-scout-tntsearch.
@vanry 那就是说,这个$asYouType
是必须要有的,对吗?
from laravel-scout-tntsearch.
@SamHz 非必须 可以去掉
from laravel-scout-tntsearch.
Related Issues (20)
- lumen5.8能用吗? HOT 3
- 有表前缀情况 HOT 1
- laravel7以上还不能用吧? HOT 6
- 搜索结果高亮问题 HOT 2
- 采用jieba分词器如何做到分词最小化? HOT 2
- 你好,升级laravel7以后,出现Target class [tntsearch.tokenizer] does not exist. HOT 2
- 有办法根据不同字段不同匹配程度排序嘛 HOT 4
- laravel8安装报错,请问如何处理? HOT 2
- 能否加入min_score的API支持? HOT 1
- 导入数据后,在添加where查询,调用paginate时,total统计数量不对 HOT 2
- Class Vanry\Scout\Tokenizers\JiebaTokenizer contains 1 abstract method and must therefore be declared abstract or implement the remaining methods HOT 2
- 请问如何加 whereIn 或者是 constrain 方法? HOT 1
- 创建索引后用分词搜索不到结果 HOT 1
- 无法使用scout9.3 HOT 6
- laravel 9 依赖冲突
- Laravel9依赖冲突
- 请问结果中的高亮该怎么做呢? HOT 2
- 联表查询怎么加约束条件
- 怎么用orderBy查询语句呢? HOT 3
- 使用另一种修改语句来修改数据,同步索引没能生效 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-scout-tntsearch.