본문 바로가기

카테고리 없음

elastiesearch with multiple condition

예시

{
  "query": {
    "bool": {
      "filter": [
        {
          "bool": {
            "should": [
              {
                "term": {
                  "region_type": "city"
                }
              }
            ]
          }
        },
        {
          "wildcard": {
            "region_name": "*seoul*"
          }
        }
      ]
    }
  }
}

 

 

참고

- https://stackoverflow.com/a/40755927/10194999

 

elasticsearch bool query combine must with OR

I am currently trying to migrate a solr-based application to elasticsearch. I have this lucene query (( name:(+foo +bar) OR info:(+foo +bar) )) AND state:(1) AND (has_image:(0) OR has_...

stackoverflow.com

- https://discuss.elastic.co/t/filtered-wildcard-query/143259/4

 

Filtered wildcard query

That's why I'd encourage you looking at ngrams instead. You'll pay the price at index time (disk space wise and index time) but don't pay it at search time. Did you try my query proposal? Could you also try this one? GET index/_search { "query": { "bool":

discuss.elastic.co

쿼리 만들어 요청보내는 example이 더 많아야 할것같음...