小编Yif*_*ery的帖子

Elasticsearch 如何使用通配符进行 OR 查询

我很难尝试使用 elasticsearch 构建查询。

我想查询类似的东西:

WHERE field_1 is 'match' $string OR field_2 is 'wildcard_match' $string OR field_3 is 'fuzzy' $string
Run Code Online (Sandbox Code Playgroud)

所以我试图构建的是这样的:

{
    "bool" : {
        "should" : [
            {
                "match" : { "field_1" : "testing" }
            },
            {
                "wildcard" : { "field_2" : "*testing*" }
            },
            {
                "fuzzy" : { "field_3" : "testing" }
            }
        ],
        "minimum_should_match" : 1,
    }
}
Run Code Online (Sandbox Code Playgroud)

但这似乎返回一个错误。

任何人都可以指点我应该如何研究使用elasticsearch进行这种OR查询?

我当前的数据发送:

{
  "_index": "twitter",
  "_type": "tweet",
  "_id": "1",
  "_version": 1,
  "found": true,
  "_source": {
    "field_1": "some data",
    "field_2": …
Run Code Online (Sandbox Code Playgroud)

php elasticsearch

3
推荐指数
1
解决办法
2045
查看次数

添加/减去两个数字字符串

我有两个变量,大数字设置为字符串:

var numA = "340282366920938463463374607431768211456"
var numB = "17014118346046923173168730371588410572"
Run Code Online (Sandbox Code Playgroud)

我希望能够在Go中添加和减去这些类型的大字符串数字.

我知道我需要使用,math/big但我仍然不能为我的生活弄清楚如何,所以任何示例帮助将不胜感激!

math biginteger go

2
推荐指数
1
解决办法
139
查看次数

标签 统计

biginteger ×1

elasticsearch ×1

go ×1

math ×1

php ×1