Download the PHP package antsfree/mxusearch without Composer

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

基于讯搜服务封装的全文检索服务(for laravel)

服务说明

全文检索服务是基于开源项目xunsearch封装的全文搜索引擎,服务仍在完善。

服务安装配置

1. 通过composer 安装搜索服务, 输入如下命令安装最新版本.

2. 在 config/app.php 的服务数组 providers 中添加以下服务.

3. 在 config/app.php 的门面数组 aliases 中添加以下门面.

4. 执行如下命令, 配置mxusearch.php配置文件;

5. 分布式安装,各自laravel项目需要配置以下env参数:

env配置 中文释义 默认值
MXUSEARCH_PROJECT 索引库名 mxu_project
MXUSEARCH_CHARSET 字符编码 utf-8
MXUSEARCH_INDEX_HOST 索引服务器IP 127.0.0.1(分布式部署配置详见“注意”)
MXUSEARCH_INDEX_PORT 索引端口 8383
MXUSEARCH_SEARCH_HOST 搜索服务器IP 127.0.0.1(分布式部署配置详见“注意”)
MXUSEARCH_SEARCH_PORT 搜索端口 8384
MXUSEARCH_INI INI配置文件名 mxusearch.ini

注意:以上配置全都有默认值,其中索引、搜索的host在分布式部署上需要注意区分。统一指向讯搜服务所在服务器。

6. 执行console命令,生成ini文件

基本服务方法设定

序号 方法名称 中文释义 备注
1 addIndex 创建索引 单条支持即时同步,多条存在时间误差,具体在2~3分钟,视具体情况
2 deleteIndex 删除索引 单条多条立即生效,无延迟
4 searchIndex 查找索引 支持setFuzzy模糊查询,支持特定字段定向查询(column:key)
5 cleanIndex 清空索引 立即生效,无延迟
6 rebuildIndex 重建索引 暂不支持
7 getIndexCount 获取索引总数
8 checkServer 检测全文检索服务状态 直接输出当前状态及索引条数
9 flushIndex 强制刷新搜索日志
10 getHotWords 获取热门搜索词
11 getMatchNum 获取索引匹配数量
12 flushIndex 强制刷新索引 强制刷新实现索引的即加即搜
13 flushLogging 强制刷新搜索日志
14 checkServer 讯搜服务状态检测
15 getKeyWords 文本分词功能
16 resetIniFile 重置INI文件方法
17 multiSearch 多条件查询

Artisan命令服务

提供 artisan 的命令实现 :

序号 artisan命令 console释义 备注
1 search:add 创建索引 单条支持即时同步,多条存在时间误差,具体在2~3分钟,视具体情况
2 search:delete 删除索引 单条多条立即生效,无延迟
3 search:search 查找索引 终端交互,可选择匹配范围
4 search:clear 清空索引 立即生效,无延迟
5 search:check-server 检测全文检索服务状态 直接输出当前状态及索引条数
6 search:flush 强制刷新索引及搜索日志 默认为异步创建索引,强制刷新实现索引的即加即搜
7 search:scws 文本分词命令
8 search:reset-ini 重置ini文件 根据配置项重新配置INI文件
9 search:list-hotwords 查看热词列表 命令行直接输出

ini配置

1、 ini配置文件:mxu-backend/config/mxusearch.ini ;

2、 服务器配置

3、索引字段配置

方法说明

multiSearch(多条件查询)

方法示例

请求参数

参数名 类型 参数说明 必填 备注
$keyword string 关键词 N
$field string 字段名 N 默认null,表示全文匹配
$other_field_value array 其他多条件参数 N 默认空数组
$range array 区间条件筛选 N
$limit int 分页参数 N 默认10条
$page int 分页参数 N 默认1
$sorts array 排序条件 N 默认空

请求示例

索引管理注意事项:

  1. 索引更新:多条同时更新存在时间误差,具体时长和需要创建的索引数量有关系,具体在2~4分钟能实现索引的更新;
  2. 索引创建:多条同时新增存在时间误差,具体时长和需要创建的索引数量有关系,具体在2~4分钟能实现索引的创建;
  3. 当前只支持单库存储;
  4. ini配置默认存于laravel config目录中;

TODO List

  1. 增加热词删除服务;
  2. 重构或者优化高级搜索服务,支持搜索条件/类型可扩展;

讯搜服务官方SDK参考

讯搜 SDK 指南


All versions of mxusearch with dependencies

PHP Build Version
Package Version
No informations.
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 antsfree/mxusearch contains the following files

Loading the files please wait ....