The document has an example: https://laravel.com/docs/5.3/...
As follows:
$users = DB::table('users')
->where('name', 'like', 'T%')
->get();
Question 1:
The above example only searches for one field name. If I have an articles table with two fields title and content that need fuzzy search, how should I write it?
$keywords= $request->input('keywords');
$articles = DB::table('articles')
->where('content', 'like', $keywords.'%') //这一句里面不止content,而是title和content两个字段
->get();
Question 2:
Are there any other settings or operations required to search for Chinese?
Using Like to search Chinese does not require other settings or operations. It is not recommended to use like for this kind of full-text search operation. It is best to use search engines such as ElasticSearch or Sphinx to achieve it
You can try full text search