mysql 文章搜索_【mysql】xunsearch搜索文章可以搜索出来,搜索用户却搜索不出来...

1. 我使用xunsearch做搜索功能,为两张表建立了文档索引,一个是文章表,一个是用户表2. 我的配置文件有两个user.ini article.ini 内容如下project.name = userproject.default_charset = utf-8server.index = xxx:8383server.search = xxx:8384[id]type = id[nickna...
摘要由CSDN通过智能技术生成

1. 我使用xunsearch做搜索功能,为两张表建立了文档索引,一个是文章表,一个是用户表

2. 我的配置文件有两个user.ini article.ini 内容如下

project.name = user

project.default_charset = utf-8

server.index = xxx:8383

server.search = xxx:8384

[id]

type = id

[nickname]

index = self

phrase = yes

[avatar]

[article_numbers]

type = numeric

[follow_numbers]

type = numeric

[fans_numbers]

type = numeric

[createtime]

type = numeric

project.name = article

project.default_charset = utf-8

server.index = xxx:8383

server.search = xxx:8384

[id]

type = id

[author]

type = string

[user_id]

[category_id]

index = self

tokenizer = full

[category]

type = both

[title]

type = title

[cover_url]

type = both

[content]

type = body

[reply_numbers]

type = numeric

[star_numbers]

type = numeric

[read_numbers]

type = numeric

[createtime]

type = numeric

3. 建立索引文档

/**

* 根据文章生成或者更新索引文档

* @param $type string 根据参数判断是更新(update)还是重新生成文章文档(add)

* @param $subject string 根据参数判断是生成文章索引(article)还是生成用户索引(user)

* @return bool

* @throws \XSException

* @throws \think\exception\DbException

*/

p

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值