Download the PHP package linshunwei/laravel-xunsearch without Composer

On this page you can find all versions of the php package linshunwei/laravel-xunsearch. 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-xunsearch

Laravel XunSearch

介绍

这个包是在 laravel/scout 的服务中添加拓展,使用 XunSearch 搜索 功能。

XunSearch 的安装,具体查看 XunSearch 的官方文档

laravel/scout 的安装和使用,查看 laravel/scout 的官方文档

安装

使用 composer

在配置文件中添加服务提供者(Laravel5.5 有自动添加)

复制配置文件到配置目录,配置文件内容不多,而且可以在 .env 文件中设置。手动复制或者使用命令复制:

修改 scout 配置文件 config/scout.php,让 scout 使用 XunSearch 引擎

或者直接在 .env 文件中设置

修改 XunSearch 配置文件 config/xunsearch.php

或者直接在 .env 文件中设置需要修改的内容,没有特殊情况默认即可

使用

Model 中使用搜索功能,先引入 Searchable Trait,详见 Scout 使用文档

要使用 XunSearch, Model 还要实现指定接口,同时如果有需要,可以使用 XunSearchTrait Trait (Trait 中注册了范围检索方法 range 和清空所有数据方法 cleanSearchable)。 实现接口需要添加 xunSearchFieldsType 方法进行字段类型设置

设置的字段类型的具体效果,查看 XunSearch 官方文档

Model 的主键,例如 id,已被默认设为引擎的文档主键。 如果需要对 id 进行区间检索,把 id 的类型设为 self::XUNSEARCH_TYPE_NUMERIC。如果不需要对 id 进行检索,可以不添加 id 字段。

字段类型 self::XUNSEARCH_TYPE_TITLEself::XUNSEARCH_TYPE_BODY 只能分别设置一次。

XunSearchTrait 中给 Scout 的 Builder 注册了 range 方法进行区间检索。除了 titlebody 特殊字段, XunSearch 默认设定字段为 string,需要进行区间检索的字段,要设为 numeric 或者 date 才能正常检索。

例如设定 id 字段为 self::XUNSEARCH_TYPE_NUMERIC,在 id 大于 20 小于等于 60 的范围内搜索 keyword

例如设定 id 字段为 self::XUNSEARCH_TYPE_NUMERIC,在 id 倒序排序搜索 keyword

字段的索引 index 和分词器 tokenizer 的设置效果,在 XunSearch 官方文档 查看。

相关链接

laravel/scout

laravel/scout 文档

hightman/xs-sdk-php

XunSearch 文档


All versions of laravel-xunsearch with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
laravel/scout Version ^7.0|^8.0
hightman/xunsearch Version ^1.4
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 linshunwei/laravel-xunsearch contains the following files

Loading the files please wait ....