es guass 案例

原创 2016年08月31日 15:26:16
_analyze?analyzer=standard



curl -XPOST http://192.168.1.47:9200/searchtube

"search_analyzer": "ik_max_word",
"analyzer": "ik_max_word"

curl -XPUT http://192.168.1.47:9200/searchtube/video/_mapping -d '{
  "video": {
    "properties": {
      "title": {
        "type": "string",
        "search_analyzer": "ik_max_word",
        "analyzer": "ik_max_word"
      },
      "description": {
        "type": "string",
        "search_analyzer": "ik_max_word",
        "analyzer": "ik_max_word"
      },
      "views": {
        "type": "integer"
      },
      "likes": {
        "type": "integer"
      },
      "created_at": {
        "type": "date",
        "format" : "yyyy/MM/dd HH:mm:ss||yyyy/MM/dd"
      }
    }
  }
}'


curl -XPUT http://192.168.1.47:9200/searchtube/video/1 -d '{
  title: "pg.com",
  description: "pg.com",
  views: 500,
  likes:2,
  created_at: "2014/04/22 04:00:00"
}'


curl -XPUT http://192.168.1.47:9200/searchtube/video/2 -d '{
  title: "欧莱雅",
  description: "欧莱雅品牌",
  views: 6000,
  likes: 100,
  created_at: "2014/04/22 05:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/3 -d '{
  title: "bmw",
  description: "bmw",
  views: 100,
  likes: 130,
  created_at: "2014/04/22 06:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/8 -d '{
  title: "宝马",
  description: "bmw",
  views: 100,
  likes: 130,
  created_at: "2014/04/22 07:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/9 -d '{
  title: "宝马 x6",
  description: "bwm.com",
  views: 900,
  likes: 730,
  created_at: "2014/04/22 08:00:00"
}'
curl -XPUT http://192.168.1.47:9200/searchtube/video/10 -d '{
  title: "宝马 x10",
  description: "bwm.com bmw",
  views: 90,
  likes: 630,
  created_at: "2014/04/22 09:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/11 -d '{
  title: "宝马 x11",
  description: "bwm.com bmw",
  views: 200,
  likes: 530,
  created_at: "2014/04/22 10:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/4 -d '{
  title: "baidu",
  description: "baidu.com",
  views: 100,
  likes:2,
  created_at: "2014/04/22 09:00:00"
}'


curl -XPUT http://192.168.1.47:9200/searchtube/video/5 -d '{
  title: "宝洁",
  description: "pg.com",
  views: 300,
  likes:2,
  created_at: "2014/04/22 10:00:00"
}'


curl -XPUT http://192.168.1.47:9200/searchtube/video/6 -d '{
  title: "宝洁 广告",
  description: "pg.taobao.com",
  views: 300,
  likes:2,
  created_at: "2014/04/22 11:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/7 -d '{
  title: "天猫",
  description: "taoobao.com",
  views: 800,
  likes:2,
  created_at: "2014/04/22 13:00:00"
}'


curl -XPUT http://192.168.1.47:9200/searchtube/video/12 -d '{
  title: "宝马 x12",
  description: "bwm.com bmw",
  views: 200,
  likes: 530,
  created_at: "2014/04/23 10:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/13 -d '{
  title: "宝马 x13",
  description: "bwm",
  views: 200,
  likes: 530,
  created_at: "2014/04/24 10:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/14 -d '{
  title: "bmw",
  description: "bwm",
  views: 200,
  likes: 530,
  created_at: "2014/04/24 11:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/15 -d '{
  title: "bmw",
  description: "bwm",
  views: 200,
  likes: 530,
  created_at: "2014/04/24 12:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/16 -d '{
  title: "bmw 24",
  description: "bmw",
  views: 200,
  likes: 530,
  created_at: "2014/04/24 13:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/17 -d '{
  title: "bmw 25",
  description: "bmw",
  views: 200,
  likes: 530,
  created_at: "2014/04/24 14:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/18 -d '{
  title: "bmw 25",
  description: "bmw",
  views: 200,
  likes: 530,
  created_at: "2014/04/25 14:00:00"
}'

curl -XPUT http://192.168.1.47:9200/searchtube/video/19 -d '{
  title: "bmw 25",
  description: "bmw",
  views: 200,
  likes: 530,
  created_at: "2014/04/26 14:00:00"
}'


curl -XPUT http://192.168.1.47:9200/searchtube/video/20 -d '{
  title: "宝马 x12",
  description: "bwm.com bmw",
  views: 200,
  likes: 530,
  created_at: "2014/04/23 11:00:00"
}'


curl -XPUT http://192.168.1.47:9200/searchtube/video/21 -d '{
  title: "宝马 x12",
  description: "bwm.com bmw",
  views: 200,
  likes: 530,
  created_at: "2014/04/23 12:00:00"
}'



curl -XPUT http://192.168.1.47:9200/searchtube/video/22 -d '{
  title: "宝马 x12",
  description: "bwm.com bmw",
  views: 200,
  likes: 530,
  created_at: "2014/04/23 13:00:00"
}'


curl -XPOST http://192.168.1.47:9200/searchtube/_search -d '
{
  "query": {
    "function_score": {
      "query": {"match": {"_all": "severed"}},
      "script_score": {
        "script": "_score * log(doc['likes'].value + doc['views'].value + 1)"
      }
    }
  }
}'



curl -XPOST http://192.168.1.47:9200/searchtube/_search -d '
{
  "query": {
    "function_score": {
      "query": {"match": {"_all": "severed"}},
      "script_score": {
        "script": "_score * doc['views'].value + 1"
      }
    }
  }
}'



{
  "query": {
    "function_score": {
        "functions": [
          {
            "gauss": {
                "created_at": {
                    "origin": "2014-04-22T23:50:00",
                    "scale": "12h",
                    "offset": "1h",
                    "decay": 0.3
                }
            }
          },
          {
            "gauss": {
              "likes": {
                  "origin": 20000,
                  "scale": 20000
              }
            }
          },
          {
            "gauss": {
              "views": {
                  "origin": 20000,
                  "scale": 20000
              }
            }
          }
        ]
    }
  }
}



curl -XGET 'localhost:9200/hotels/_search/?pretty' -d'
{
  "query": {
    "function_score": {
      "functions": [
        {
          "gauss": {
            "price": {
              "origin": "0",
              "scale": "20"
            }
          }
        },
        {
          "gauss": {
            "location": {
              "origin": "11, 12",
              "scale": "2km"
            }
          }
        }
      ],
      "query": {
        "match": {
          "properties": "balcony"
        }
      },
      "score_mode": "multiply"
    }
  }
}'

版权声明:本文为博主原创文章,未经博主允许不得转载。

sdcard文件读写案例-ES文件浏览器

  • 2015年01月07日 12:14
  • 1.43MB
  • 下载

Android中的OpenGL ES使用案例

做了很多年的OpenGL开发,今天试了下android平台下的OpenGL ES,感觉还是很熟悉,基本上跟OpenGL一模一样。但也体会到几点区别: (1)OpenGL ES不再是C语言风格函数,里...

es 基本语法 使用 案例

elasticsearch 语法汇总 使用 es 已有段时间 今天 有时间 就把最近使用用到的知识点 记录下来,以备后续使用 es 安装 和插件配置 等知识 这里就不在 累述 1 基本命令 使...

OpenGL ES2.0---凿岩车钻臂3D案例之MatrixState类详解

先附上源代码。 import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; impo...

OpenGL ES2.0---凿岩车钻臂3D案例之加载顶点shader和片元shader类的方法

在asset目录下放入写好的顶点和片元着色器的文件。现在开发加载顶点和片元着色器的方法类。先附上源代码。 import java.io.ByteArrayOutputStream; import ...

ES6 导出组件或属性 方式案例

ES6 导出组件或属性 ES6 导出属性 匿名方式 // 定义:匿名对象存放所需要的属性 // CommonData.js export default{ title:"cralos", ...

Webpack3.0小案例(二) -- css处理与ES6编译

写在前面在webpack3.0小案例webpack初体验 一文中,我们从整体了解了webpack相关特性并手动初步实现了一个可执行编译的webpack环境,这一节,将在此基础上继续探讨以下功能的实现:...
  • tycsbs
  • tycsbs
  • 2017年11月30日 14:44
  • 36

es 学习 5 DSL mapping 使用 案例

Guass过程与Brown运动

  • 2008年09月18日 14:20
  • 299KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:es guass 案例
举报原因:
原因补充:

(最多只允许输入30个字)