热卖商品
新闻详情
Yii2 ElasticSearch的使用 - TinyMeng呀!
来自 : www.majiameng.com/article/14..
发布时间:2021-03-24
\'id\' = [\'type\' = \'integer\', index = true], \'title\' = [\'type\' = \'text\', index = true, analyzer = \'ik_max_word\',\'search_analyzer\'= \'ik_max_word\'],//ik中文分词 \'type\' = [\'type\' = \'integer\', index = true], \'inputtime\' = [\'type\' = \'integer\', index = true],//文章创建时间 \'updatetime\' = [\'type\' = \'integer\', index = true],//文章更新时间 \'content\' = [\'type\' = \'text\', index = true, analyzer = \'ik_max_word\',\'search_analyzer\'= \'ik_max_word\'],//文章内容 \'other\' = [\'type\' = \'text\', index = false],//\' index = false\' 不进行分词 public static function mapping() return [ static::type() = self::mapConfig(), * Set (update) mappings for this model public static function updateMapping(){ $db = self::getDb(); $command = $db- createCommand(); if(!$command- indexExists(self::index())){ $command- createIndex(self::index()); $command- setMapping(self::index(), self::type(), self::mapping()); public static function getMapping(){ $db = self::getDb(); $command = $db- createCommand(); return $command- getMapping();
2018年8月17日{ return \Yii::$app->get('elasticsearch'); } /** * Description: 定义字段映射的方法 * Author: JiaMeng <666@majiameng.com> * Updater: * @param...Yii2 ElasticSearch的使用Yii2 elasticSearch – 配置配置部分如下:'elasticsearch' => [ 'class' => '...Yii2 ElasticSearch的使用
2018年8月17日{ return \Yii::$app->get('elasticsearch'); } /** * Description: 定义字段映射的方法 * Author: JiaMeng <666@majiameng.com> * Updater: * @param...Yii2 ElasticSearch的使用Yii2 elasticSearch – 配置配置部分如下:'elasticsearch' => [ 'class' => '...Yii2 ElasticSearch的使用
本文链接: http://yiima.immuno-online.com/view-715773.html
发布于 : 2021-03-24
阅读(0)
最新动态
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
联络我们