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


(blickensdoerfer@googlemail.com) #1

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!!!


(Shay Banon) #2

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 <
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!!!


(system) #3