# Query with filtered Index giving no results (river-couchdb)

**URL:** <https://discuss.elastic.co/t/query-with-filtered-index-giving-no-results-river-couchdb/3714>\
**Category:** Elasticsearch\
**Created:** [December 30, 2010, 12:53pm UTC](https://discuss.elastic.co/t/query-with-filtered-index-giving-no-results-river-couchdb/3714 "2010-12-30T12:53:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blickensdoerfer](https://avatars.discourse-cdn.com/v4/letter/b/b5e925/32.png) [@blickensdoerfer](https://discuss.elastic.co/u/blickensdoerfer)\
**Post date:** [December 30, 2010, 12:53pm UTC](https://discuss.elastic.co/t/query-with-filtered-index-giving-no-results-river-couchdb/3714/1 "2010-12-30T12:53:12Z")

</div>

hi all

i'm quite new with elasticsearch and so far everything works fine. but  
now i added an index with filter on couchdb:

CURL request

\_meta' -d '{  
"type" : "couchdb",  
"couchdb" : {

```
    "host" : "localhost",
    "port" : 5984,
    "db" : "mydb",
    "filter" : "app\/glossar",
"filter_params":{
	"type": "glossar"
}
}

```

}'

Design Doc for filter in couch:  
{  
"\_id": "\_design/app",  
"\_rev": "3-d694e1de9fe4ea047038e95b2bd2a4d6",  
"filters": {  
"glossar": "function(doc, req) { if (doc.type == 'glossar')  
{return true;} else { return false;} }"  
}  
}

index is up and working, elasticsearch is giving no errors, but when i  
do a query like:

{"query":{"bool":{"must":[{"query\_string":  
{"default\_field":"title","query":"_term_"}}

i never get any results, though there should be a lot

anyone knows what i'm doing wrong? i tried to leave out the bool/must  
party already, nothing happens too

thanks a lot!!!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 30, 2010, 2:35pm UTC](https://discuss.elastic.co/t/query-with-filtered-index-giving-no-results-river-couchdb/3714/2 "2010-12-30T14:35:31Z")

</div>

Two things to check it:

1. See if there is data in elasticsearch. Thats a simple: curl  
localhost:9200/\_search?q=\*
2. Maybe the filter is not working as expected. You can test that by issuing  
using curl the same \_change api call that elasticsearch issues to couchdd:

/\_changes?feed=continuous&include\_docs=true&heartbeat=10000&filter=  
app/glossar&type=glossar

On Thu, Dec 30, 2010 at 2:53 PM, [blickensdoerfer@googlemail.com](mailto:blickensdoerfer@googlemail.com) \<  
[blickensdoerfer@googlemail.com](mailto:blickensdoerfer@googlemail.com)\> wrote:

> hi all
> 
> i'm quite new with elasticsearch and so far everything works fine. but  
> now i added an index with filter on couchdb:
> 
> CURL request
> 
> \_meta' -d '{  
> "type" : "couchdb",  
> "couchdb" : {
> 
> ```
> "host" : "localhost",
> "port" : 5984,
> "db" : "mydb",
> "filter" : "app\/glossar",
> "filter_params":{
> "type": "glossar"
> }
> 
> ```
> 
> }  
> }'
> 
> Design Doc for filter in couch:  
> {  
> "\_id": "\_design/app",  
> "\_rev": "3-d694e1de9fe4ea047038e95b2bd2a4d6",  
> "filters": {  
> "glossar": "function(doc, req) { if (doc.type == 'glossar')  
> {return true;} else { return false;} }"  
> }  
> }
> 
> index is up and working, elasticsearch is giving no errors, but when i  
> do a query like:
> 
> {"query":{"bool":{"must":[{"query\_string":  
> {"default\_field":"title","query":"_term_"}}
> 
> i never get any results, though there should be a lot
> 
> anyone knows what i'm doing wrong? i tried to leave out the bool/must  
> party already, nothing happens too
> 
> thanks a lot!!!

---

<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, 4:14am UTC](https://discuss.elastic.co/t/query-with-filtered-index-giving-no-results-river-couchdb/3714/3 "2017-07-06T04:14:39Z")

</div>


