# Multi Query and Querying with Spaces

**URL:** https://discuss.elastic.co/t/multi-query-and-querying-with-spaces/321704
**Category:** Kibana
**Created:** [December 20, 2022, 11:15pm UTC](https://discuss.elastic.co/t/multi-query-and-querying-with-spaces/321704 "2022-12-20T23:15:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Cal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cal/32/127008_2.png) [@Cal](https://discuss.elastic.co/u/Cal)
#### Post date: [December 20, 2022, 11:15pm UTC](https://discuss.elastic.co/t/multi-query-and-querying-with-spaces/321704/1 "2022-12-20T23:15:20Z")

</div>

Hello,

I'm setting various visualizations to filter on Kibana and I need to be able to search by specific words in a text description. Let's say I have a paragraph description and I want to populate results when "Blue" or "Red" come up or "Puppy Dog" comes up.

Here is what I have so far...

1. The below query results in any entry with red or blue in the selected field. Is this the most efficient way to write this out?

2. How would I search for "Puppy Dog" since it has a space, without searching for "puppy" and "dog" separately?

```auto

{
  "query": {
    "query_string": {
      "default_field": "Paragraph",
      "query": "*Red* and *Blue*"
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [December 21, 2022, 7:52am UTC](https://discuss.elastic.co/t/multi-query-and-querying-with-spaces/321704/2 "2022-12-21T07:52:24Z")

</div>

Hey! Have you tried something like:

```auto
{
  "query": {
    "query_string": {
      "default_field": "Paragraph",
      "query": "(*Red*) OR (Puppy Dog) OR (*Blue*)"
    }
  }
}

```

Check the documentation here [Query string query | Elasticsearch Guide [8.5] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html)

---

<div class="post-metadata">

### Author: ![Cal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cal/32/127008_2.png) [@Cal](https://discuss.elastic.co/u/Cal)
#### Post date: [December 21, 2022, 10:44pm UTC](https://discuss.elastic.co/t/multi-query-and-querying-with-spaces/321704/3 "2022-12-21T22:44:05Z")

</div>

Hey, thanks for the reply. I tried your suggestion and it did not work, but then it gave me an idea.

Putting (_Puppy_ AND _Dog_) OR (_Blue_) returned both entries. Seems to work just fine, I'll play around more and give feedback if anything else changes.

---

<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: [January 18, 2023, 10:44pm UTC](https://discuss.elastic.co/t/multi-query-and-querying-with-spaces/321704/4 "2023-01-18T22:44:12Z")

</div>

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