0

I am using the kibana-4.5.0, elasticsearch 2.3.2

i want to find specific sentence by this query "*'ve have" in kibana. it didn't work in kibana.

so, i tried span_near fillter in kibana.

{
  "query": {
    "span_near": {
      "clauses": [
        {
          "span_term": {
            "items": "*ve"
          }
        },
        {
          "span_term": {
            "items": "have"
          }
        }
      ],
      "in_order": true,
      "slop": 1
    }
  }
}

also, it didn't work.

so, i tried search query in head plugin.

http://localhost:9200/_search
{"query" : {
    "span_near" : {
      "clauses" : [
        { "span_term" : { "items" : "we've" } },
        { "span_term" : { "items" : "have" } }
      ],
      "slop" : 1,
      "in_order" : true
    }
  }
}

i used default setting. so i guess i used to default analayzer.

also, i tried regex query it also didn't work for me.

how can i do?

"we've have" OR "i've have" OR "he've have"

that is not my hope. i hope that like "*'ve have"

thanks for read

woocheol
  • 87
  • 1
  • 8
  • Take a look at the Lucene query syntax spec. "Note: You cannot use a * or ? symbol as the first character of a search." https://lucene.apache.org/core/2_9_4/queryparsersyntax.html – bhspencer Aug 01 '16 at 01:33
  • i got it... it is impossible in elasticsearch... – woocheol Aug 01 '16 at 07:04

1 Answers1

0

It's impossible to use regex in ES the way you did it, but you can use regex in elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html

Dmitry Lovermann
  • 260
  • 1
  • 5
  • 13