Hello,

I have a small DB where I am trying to filter out certain items based on 
the value of "ifpresent" tag as shown below. The query should return me the 
list of items (or UUID of the items) for which ifpresent = 1. I have tried 
the Filters and Queries, but no avail.

I tried queries like the following:
curl -XGET http://localhost:9200/searchtest/[email protected]/_search?routing=0 
-d { "query":{ "filtered":{ "query":{ "match_all":{} }, "filter":{ 
"searchItems":{ "ifpresent":0 } } } }

but to no available. Any clues on how to get this data?


The DB looks like the following:

Result Source
{
    _index: searchtest
    _type: [email protected]
    _id: 4dc8cc35-072d-49c2-b34a-6db248ed03d6
    _version: 2
    _score: 1
    _source: {
        tags: [
            userdetails
        ]
        searchItems: [
            [
                
{"itemUUID":"b1deb6db-8afc-40b7-8d0f-abb50ef6fc96","ifpresent":"1"}
                
{"itemUUID":"ef984bc9-07dd-4ef3-981a-81a633dbf137","ifpresent":"0"}
                
{"itemUUID":"e7f9c282-18f6-43f1-8531-b694ac4e0c03","ifpresent":"2"}
                
{"itemUUID":"c681c581-32f2-46f7-907d-3a19c466bc9c","ifpresent":"0"}
                
{"itemUUID":"283bc3e9-55ce-4250-a88e-e18286e5dc8d","ifpresent":"3"}
                
{"itemUUID":"6889defb-262c-4abd-bb21-f0e233a88379","ifpresent":"0"}
                
{"itemUUID":"1b84dfeb-e80d-4e8b-bf6d-41de0dc99a8e","ifpresent":"4"}
                
{"itemUUID":"4d959b71-ab17-43fe-9606-47121984fc86","ifpresent":"0"}
                
{"itemUUID":"e5f99931-a305-4e13-8e8f-9b7c8d0b99e2","ifpresent":"5"}
                
{"itemUUID":"09da7e17-9513-4c9b-b437-ca94c26b7389","ifpresent":"0"}
            ]
        ]
        lastSyncTimeL: 0
        appversion: 1.0
        lName: Dutta
        fName: S
        id: userdetails
        lastSyncTimeS:
        deviceOSVersion: 6.0
        deviceType: Android
        gender: M
        pictureurl: yahoo.com
        mi: ""
        createDt: 2014-04-14T05:19:31.953Z
        referredNewUsers: [
            null
        ]
    }

}


-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/68b47ab8-a43f-4e8c-9c16-a88d037edcce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to