# Search with colon or Dash

**URL:** https://discuss.elastic.co/t/search-with-colon-or-dash/90713
**Category:** Kibana
**Created:** [June 24, 2017, 1:48pm UTC](https://discuss.elastic.co/t/search-with-colon-or-dash/90713 "2017-06-24T13:48:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![byjg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/byjg/32/16517_2.png) [@byjg](https://discuss.elastic.co/u/byjg)
#### Post date: [June 24, 2017, 1:48pm UTC](https://discuss.elastic.co/t/search-with-colon-or-dash/90713/1 "2017-06-24T13:48:23Z")

</div>

Hi,

I am using Kibana for store my logs but I when search fields with colon ( : ) or dash ( - ) I have unexpected results.

Follow some examples:

- Search for the full text **WORKS:**

objectId: "this.is.full.text:category:some-title:"

```
{"query": {
    "match": {
      "objectId": {
        "query": "this.is.full.text:category:some-title:",
        "type": "phrase"
      }}}}

```

- Search inside the text without use the dash or colon **WORKS** also

objectId: "this.is.full\*"

```
{"query": {
    "match": {
      "objectId": {
        "query": "this.is.full*",
        "type": "phrase"
      }}}}

```

- But if I included a colon inside the search this **NOT WORKS**

objectId: "\* category:some \*" (note: there is no space after or before the \*)

```
{"query": {
    "match": {
      "objectId": {
        "query": "*category:some*",
        "type": "phrase"
      }}}}

```

I tried escape the colon with bask-slash ( : ) but without success.

---

<div class="post-metadata">

### Author: ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)
#### Post date: [June 26, 2017, 8:25pm UTC](https://discuss.elastic.co/t/search-with-colon-or-dash/90713/2 "2017-06-26T20:25:10Z")

</div>

I believe that it's actually a problem with the match query. From the [match query docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html):

> The match family of queries does not go through a "query parsing" process. It does not support field name prefixes, wildcard characters, or other "advanced" features.

You need to change that to a `query_string` query to use wildcards correctly.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 24, 2017, 8:25pm UTC](https://discuss.elastic.co/t/search-with-colon-or-dash/90713/3 "2017-07-24T20:25:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
