zoukankan      html  css  js  c++  java
  • ElasticSearch的学习

    1下载ElasticSearch包,下载解压就行

    2在chrome浏览器添加Sense,

    请求报

    在sense下载包中的src目录下面base.js文件中的ajax方法中(只有一个)添加一行代码

       contentType: 'application/json',

    3不能输入中文,在libsrc-noconflictace.js中修改代码

    var onTextInput = function(e) {
            // 下面是新增代码
            // 当为中问输入时,且还在继续输入时不处理每次键入的字符,直接return
            if (inCompostion)
                return;
            // 上面是新增代码    
            if (!inCompostion)
                sendText(e.data);
            setTimeout(function () {
                if (!inCompostion)
                    reset(true);
            }, 0);
        };
    
    var onCompositionEnd = function(e) {
            inCompostion = false;
            host.onCompositionEnd();
            // 下面是新增代码
            // 当输入完毕后处理输入内容
            sendText(e.data);
        };    
    4报  
    Failed to parse mapping [post]: analyzer [ik_max_word] has not been configured in mappings
    这是没有安装分词器,需要下载通版本的的安装(都是7.13.4),下载完以后,就找到你的es的plugins文件夹,将zip解压,然后删掉zip。重启es就可以了(重启如果闪退,就在plugins下创建一个文件elasticsearch-analysis-ik-7.13.4)然后就可以了,后续碰到问题再记录

    安装之后,可以再class中设置分词属性(好像没什么用)

     [ElasticsearchType(RelationName = "company")]
        public class Company
        {
            public int CompanyID { get; set; }
    
            public int AccountID { get; set; }
    
            [Text( Analyzer = "ik_smart")]
            public string CompanyName { get; set; }
        }

     参考https://www.cnblogs.com/netlock/p/13899368.html

          https://www.cnblogs.com/johnyong/p/12906370.html

    完全匹配用 MatchPhrase

  • 相关阅读:
    set.end()和lower_bound使用记录
    自学图论的码队弟弟(dfs)
    打字训练
    (回归2.0)A
    斐波那契串 新疆省赛
    异或的路径 新疆省赛 (按位亦或)
    E. Product Oriented Recurrence (矩阵快速幂新模板)
    C. Beautiful Lyrics (模拟)构造
    O(n!)新疆省赛 d (贪心)
    Babelfish 分类: 哈希 2015-08-04 09:25 2人阅读 评论(0) 收藏
  • 原文地址:https://www.cnblogs.com/carlpeng/p/15084884.html
Copyright © 2011-2022 走看看