# Getting no results with match\_all Query

**URL:** <https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078>\
**Category:** Elasticsearch\
**Created:** [July 7, 2015, 7:12pm UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078 "2015-07-07T19:12:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![travagini](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@travagini](https://discuss.elastic.co/u/travagini)\
**Post date:** [July 7, 2015, 7:12pm UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078/1 "2015-07-07T19:12:55Z")

</div>

I have this structure:

```
{
   "_id": "001",
   "information": "Free Books",
   "date": "2015-07-06",
   "books": [
       {
           "title": "New Era",
           "author": "David Smith"
       },
       {
           "title": "The Warrior",
           "author": "John Calton"
       },
       {
           "title": "A great leader",
           "author": "Ana Marques"
       },
       {
           "title": "Be like water",
           "author": "Bruce Lee"
       }
   ]
}

```

When I try to do a simple query like match all, I get no results:

```
{
    "query":{
        "match_all": {}
    }
}

```

Then, when I create a new document without using array, I'm able to get the proper results in any query. I guess the problem is that I'm not using nested objetcs for the array, however, shoud not the "match\_all" query return me the results?

The index I've created:

```
curl -XPUT "localhost:9200/_river/mylibrary/_meta" -d "{
    "type" : "couchdb",
    "couchdb" : {
        "host" : "localhost",
        "port" : 5984,
        "db" : "mylibrary",
        "filter" : null
    },
    "index" : {
        "index" : "mylibrary",
        "type" : "mylibrary",
        "bulk_size" : "100",
        "bulk_timeout" : "10ms"
    }
}"

```

Why am I not getting the results?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 7, 2015, 8:54pm UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078/2 "2015-07-07T20:54:23Z")

</div>

Don't use rivers. They will be removed in 2.0.

---

<div class="post-metadata">

**Author:** ![travagini](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@travagini](https://discuss.elastic.co/u/travagini)\
**Post date:** [July 7, 2015, 9:03pm UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078/3 "2015-07-07T21:03:31Z")

</div>

Is there another way to use data from couchdb without using rivers in this case? However, what is the problem with the match\_all query that is not returning any result?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 7, 2015, 9:15pm UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078/4 "2015-07-07T21:15:27Z")

</div>

Logstash couchdb input might help.

If match all does not give any hits, it's most likely because you (or the river) did not index any doc.

---

<div class="post-metadata">

**Author:** ![travagini](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@travagini](https://discuss.elastic.co/u/travagini)\
**Post date:** [July 8, 2015, 1:18am UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078/5 "2015-07-08T01:18:50Z")

</div>

I think the problem is not about indexing because I removed the array from the document, then the query worked as expected. If I put some array in the document, query stop giving me results. Even the match\_all. If I leave just strings, without array in Json, everything works fine...

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 8, 2015, 6:42am UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078/6 "2015-07-08T06:42:09Z")

</div>

Your document looks good.

May be you can reproduce with a script the problem without using a river?  
PUT directly your docs in elasticsearch

---

<div class="post-metadata">

**Author:** ![travagini](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@travagini](https://discuss.elastic.co/u/travagini)\
**Post date:** [July 8, 2015, 2:06pm UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078/7 "2015-07-08T14:06:19Z")

</div>

Thank you. Do you have any reference showing how to synchronize data from CouchDB? I took a look at Logstash, but I got confused where should I put informations like: host, port number and index.

In river I used to put everything in localhost/\_river/\_meta like this:

```
curl -XPUT 'localhost:9200/_river/my_db/_meta' -d '{
    "type" : "couchdb",
    "couchdb" : {
        "host" : "localhost",
        "port" : 5984,
        "db" : "my_db",
        "filter" : null
    },
    "index" : {
        "index" : "my_db",
        "type" : "my_db",
        "bulk_size" : "100",
        "bulk_timeout" : "10ms"
    }
}
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 8, 2015, 2:20pm UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078/8 "2015-07-08T14:20:59Z")

</div>

Everything is documented here: [https://www.elastic.co/guide/en/logstash/current/plugins-inputs-couchdb\_changes.html](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-couchdb_changes.html)

If you don't succeed of making it work, open a new thread in the logstash section.

---

<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 6, 2017, 12:02am UTC](https://discuss.elastic.co/t/getting-no-results-with-match-all-query/25078/9 "2017-07-06T00:02:52Z")

</div>


