Skip to content

请问有没有 multi_match 对应的sql语句的写法? #638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
m358807551 opened this issue Mar 26, 2018 · 5 comments
Closed

请问有没有 multi_match 对应的sql语句的写法? #638

m358807551 opened this issue Mar 26, 2018 · 5 comments

Comments

@m358807551
Copy link

No description provided.

@shi-yuan
Copy link
Member

不好意思,目前还不支持multiMatchQuery

@m358807551
Copy link
Author

好的。谢谢。

shi-yuan pushed a commit that referenced this issue Mar 27, 2018
@shi-yuan
Copy link
Member

SELECT * FROM test WHERE q=multimatch(query='this is a test',fields='subject^3,message',analyzer='standard',type='best_fields',boost=1.0,slop=0,tie_breaker=0.3,operator='and')
{
  "from": 0,
  "size": 200,
  "query": {
    "bool": {
      "filter": [
        {
          "bool": {
            "must": [
              {
                "multi_match": {
                  "query": "this is a test",
                  "fields": [
                    "message^1.0",
                    "subject^3.0"
                  ],
                  "type": "best_fields",
                  "operator": "AND",
                  "analyzer": "standard",
                  "slop": 0,
                  "prefix_length": 0,
                  "max_expansions": 50,
                  "tie_breaker": 0.3,
                  "zero_terms_query": "NONE",
                  "auto_generate_synonyms_phrase_query": true,
                  "fuzzy_transpositions": true,
                  "boost": 1.0
                }
              }
            ],
            "adjust_pure_negative": true,
            "boost": 1.0
          }
        }
      ],
      "adjust_pure_negative": true,
      "boost": 1.0
    }
  }
}

@fenian7788
Copy link

SELECT * FROM test WHERE q=multimatch(query='this is a test',fields='subject^3,message',analyzer='standard',type='best_fields',boost=1.0,slop=0,tie_breaker=0.3,operator='and')
这个fields只允许传2个字段,我传了3个,例如 fields='aa,bb,cc' 被解析成 "fields": [ "aa", "bb,cc" ]

shi-yuan pushed a commit that referenced this issue Jun 5, 2018
@shi-yuan
Copy link
Member

shi-yuan commented Jun 5, 2018

Sorry, @fenian7788 ,fixed

yongkyun added a commit to yongkyun/elasticsearch-sql that referenced this issue May 28, 2019
* one result returned on es5.0
there is just on result on dataset ..  @allwefantasy why you made this test with 2?

* split is not working on painless (worked on groovy) . waiting for a workaround .
elastic/elasticsearch#20952

* no java7 support (travis)
no delete-by-query plugin to copy

* check java version. getting bad minor version error

* java version of sudo was 1.7 , trying to start elastic service without sudo

* can't run elasticsearch service without sudo. trying to install java8 with sudo.

* put java8 install at first

* still getting java7 on sudo , trying different approach

* getting java8 to sudo different approach

* travis - try and make sure elasticsearch is up

* new config for es5.0 yml

* add finalName elasticsearch so base folder should be elasticsearch (demand for plugins es5.0)

* fix plugin and make csv rest to work

* fix to plugin-description properties

* fix all math functions

* update README.md

* add delete tests again

* site with node server

* elasticsearch 5.0.1 release

* es 5.1.1 support
script api changed

* travis - download es 5.1.1

* 5.1.1 support

* regex support

* add auth for NLPchina#364

* update README.md

* NLPchina#364 support base_uri,usename,password url parameters

* localStorage set item auth

* es 5.1.2 support

* update README.md

* README: Fix build status heading [ci skip]

* README: Fix markdown

* es 5.2.0 support for NLPchina#402

* update README.md

* es 5.2.1 support

* update README.md

* es 5.2.2 support

* update README.md

* es 5.3.0 support for NLPchina#405

* update .travis.yml

* update README.md

* es 5.3.1 support for NLPchina#416

* update README.md

* es 5.3.2 support

* update README.md

* update README.md

* Fix Beyond SQL Heading Format

* fix bug
当查询条件里面是double 数字是,druid 默认解析完的是BigDecimal 类型的,导致 es StreamOut writer 报错

* es 5.4.0 support

* fix test issue

* update README.md

* Fix header

* es 5.4.1 support

* update README.md

* update README.md

* NLPchina#439 add property ‘min_doc_count’

* NLPchina#457 es 5.4.2 support

* update README.md

* es 5.4.3 support

* es 5.5.0 support

* update README.md

* fix bug NLPchina#469

* update README.md

* fix bug NLPchina#480

* 让ElasticSearchResultSetMetaDataBase可以获取到列的metadata信息

* NLPchina#485 es 5.5.1 support

* update README.md

* Fixbug NLPchina#479

* 修复聚合函数对查询字段不包含在include单元测试不通过问题

* fix bug NLPchina#494

* NLPchina#503 es 5.5.2 support

* update README.md

* new feature: cast, almost same sa SQL cast, cast field type to int/long/float/double/string/datetime

* fix issue NLPchina#510

* es 5.5.3 support

* es 5.6.0 support

* es 5.6.1 support

* es 5.6.2 support

* update README.md

* fix junit test

* update

* update

* update

* fix issue NLPchina#515

* Correct syntax 'sql' to 'SQL'

* NLPchina#529 es 5.6.3 support

* update README.md

* fix issue 聚合字段为内嵌类型,聚合查询不正确NLPchina#527

* test

* add param order#536 How to change the order in date_histogram

* NLPchina#538 support extended_bounds in date_histogram

* fix issues 541

* NLPchina#540 fix NullPointerException

* Add support for Elasticsearch 5.6.4

Resolves: NLPchina#545

* Update README to include 5.6.4 changes

* Add missing newline to README

* fix issue 在match_phrase中设置slop NLPchina#550

* fix issue NLPchina#563 scripted_metric almost cannot be used

* es 5.6.5 support

* update README.md

* commit for 6.0.0 - compiling but not working, most tests are broken

* fix tests NLPchina#553

* update README.md

* update elasticsearch.yml

* es 6.0.1 support

* es 6.1.0 support

* es 6.1.1 support

* update README.md

* regex support

* fix delete by query NLPchina#347

* Support Field Collapsing

* support post_filter hint NLPchina#586

* fix nested order have bug NLPchina#438

* es 6.1.2 support

* Update controllers.js

just some wording

* Update README.md

* update README.md

* terms agg add execution_hint NLPchina#598

* fix Got error when filter with boolean field NLPchina#603

* fix CSV option giving -Infinity and Nan NLPchina#597

* es 6.1.3 support

* update README.md

* es 6.2.0 support

* es 6.2.1 support

* update README.md

* fix 6.2.1 Error on installation NLPchina#610

* upgrade version

* es 6.2.2 support

* update README.md

* fix issue RANGE COUNT PROBLEAM NLPchina#619

* fix issue [Feature request]Provide option to get query as locally on client, without connection to ES NLPchina#618

* fix nested类型字段不存在的情况下,用elasticsearch-sql无法查询到 NLPchina#628

* es 6.1.4 support

* es 6.2.3 support

* update README.md

* support multi_match query NLPchina#638

* NLPchina#640 date math support in index names

* support time zone in date format function

* NLPchina#531 add include and exclude

* NLPchina#648 es 6.2.4 support

* update README.md

* fix NLPchina#653 复杂运算查询会报错

* support scroll_id in sql NLPchina#575

* fix NLPchina#657 last(),IsLast()这类方法以后也不打算支持吗

* support connectionProperties for JDBC

* support multiple type of logs function

1) log2(param)
2) log10(param)
3) log(param) base=e
4) log(base_number, param)

* fix power function parameter error

change pow(a) to pow(a,b)

* fix NLPchina#638 bug

* fix NLPchina#678 range aggregation how to spec alias?

* es 6.3.0 support

* update README.md

* fix NLPchina#686

* support date_histogram,histogram and terms aggregations with scripts

* es 6.3.1 support

* update README.md

* fix NLPchina#714 SQL parse error when where condition contains 'join' keyword

* Update README.md

* es 6.3.2 support

* update README.md

* NLPchina#736 fix testcase selectFieldWithSpace

* fix NLPchina#742

* fix 使用jdbc调用metaData.getColumnCount()函数无法获取正常列数信息的问题 NLPchina#751

* fix bug#connection in druid infinitely increased

* es 6.4.0 support

* update README.md

* fix NLPchina#734

* es 6.4.1 support

* update README.md

* fix NLPchina#688 How to use the feature 'inner_hits' when filed is the array of nested object

* es 6.4.2 support

* update README.md

* fix NLPchina#781 中文查询无结果

* fix bug in floor(cast(var as int)  and sum(cast(var as int))

* fix NLPchina#779 How to use SpanNearQuery in SQL Plugin

* update testcase testSpanNearQueryExplain

* fix NLPchina#791 字段运算后聚合结果为0

* es 6.4.3 support

* es 6.5.0 support

* fix NLPchina#800 nested parser

* fix NLPchina#807 时区问题

* update .travis.yml

* es 6.5.1 support

* update README.md

* update README.md

* fix NLPchina#821 date_histogram offset

* es 6.5.2 support

* update README.md

* fix NLPchina#826 es 6.5.3 support

* update README.md

* close resultset when closing preparedstatement

* update README.md

* Merge pull request NLPchina#793 from LongLonger/elastic6.1.1_zhongshu_dev_01

* es 6.5.4 support

* update README.md

* fix NLPchina#853

* fix NLPchina#847

* support json to extended_bounds config of dateHistogram

* check agg is an instance of termsagg before set size or shardsize

* count(distinct a) 排序问题

* add testcase for NLPchina#862

* fix NLPchina#838 sql返回结果按照字段顺序返回

* fix NLPchina#839 support stats-groups

* es 6.6.0 support

* fix NLPchina#877 Cast not used in the where condition

* update README.md

* Update README.md

* fix NLPchina#884 delete sql support CONFLICTS hint

* fix NLPchina#904 es 6.6.1 support

* es 6.6.2 support

* update README.md

* es 6.7.0 support

* update README.md

* update .travis.yml

* fix NLPchina#917 check search response

* es 6.7.1 support

* update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants