Download the PHP package vanry/laravel-scout-tntsearch without Composer

On this page you can find all versions of the php package vanry/laravel-scout-tntsearch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-scout-tntsearch

说明: 2.x 版本只支持 Laravel 5.5 以上版本,Laravel 5.5以下版本请使用 1.x版本

安装

需安装并开启 sqlite 扩展

Laravel

Lumen

Lumen 需将服务提供者添加到 bootstrap/app.php

在根目录中创建 config 文件夹, 将 laravel scout 配置文件 scout.php 复制到 config 中。

如需修改 tntsearch 默认配置,则将配置文件 tntsearch.php 复制 config 中进行修改。

启用

.env 文件中添加

用法

  1. 模型添加 Searchable Trait

  2. 导入模型 创建索引

  3. 使用索引进行搜索

中文分词

目前支持 scws, jiebaphpanalysis 中文分词,默认使用 phpanalysis 分词。

对比

安装

使用 scws 或者 jieba,需安装对应的分词驱动。

.env 文件中配置

问题

使用 jieba 分词可能会出现内存分配不足的错误信息:

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)

在代码中增加内存限制即可

高亮

默认使用 em 作为高亮 html 标签,在 css 中设置高亮样式即可,也可以自定义高亮标签。

  • $text: 要高亮的字段
  • $query: 搜索词
  • $tag: 高亮的 html 标签

highlight 帮助函数和 Highlighter 对象适合在 api 等非 html 视图中使用。


All versions of laravel-scout-tntsearch with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0|^8.0
illuminate/console Version ~5.5|^6.0|^7.0|^8.0
illuminate/database Version ~5.5|^6.0|^7.0|^8.0
illuminate/support Version ~5.5|^6.0|^7.0|^8.0
illuminate/view Version ~5.5|^6.0|^7.0|^8.0
laravel/scout Version ^7.0|^8.0|^9.0
lmz/phpanalysis Version ^1.0
teamtnt/tntsearch Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vanry/laravel-scout-tntsearch contains the following files

Loading the files please wait ....