[SOLUTION]

As Binh suggest, I use script filter and was awesome, the query was:

{
  "query" : {
      "filtered": {
         "query" : {
            ...
         }
         "filter": {
           "script": {
             "script": "doc['User.id'].value != 
doc['Listing.user_id'].value"
           }
         }
      }
   }
}




El jueves, 3 de abril de 2014 16:52:29 UTC-3, @mromagnoli escribió:
>
> Hi everybody, 
> I'm having the next issue:
>
> I was wondering if via scripting or another way, I could be able to 
> discard documents retrieved based in results from the documents themselves 
> (what!?).
>
> I'll explain myself better:
>
> Suppose I have a document indexed like: 
>
>           {
>                "Review": {
>                   "body": "",
>                   "listing_id": 352755,
>                   "user_id": 4670,
>                   "title": "Bla",
>                   "message": "Blablabla bad service. ",
>                   "id": 263
>                },
>                "User": {
>                   "id": 4670,
>                   "first_name": "",
>                   "email": "[email protected]",
>                   "username": "example",
>                   "password": "123456"
>                },
>                "Listing": {
>                   "id": 352755,
>                   "user_id": 4670,
>                   "website_url": "",
>                   "zip_code": "3500",
>                   "description": "Bla bla many things"
>                }
>             }
>
>
> Where I index *Reviews *from *Users* made in *Listings, *but I don't want 
> to retrieve those documents where field *User.id == Listing.user_id. *But 
> I don't know how to determine this condition when I want to dismiss a 
> document based in a condition that lives inside it.
> Is there any way to cover this limitation?
>
> Hope I was clear.
>
> Thanks in advance!
>
> Chelo (@mromagnoli)
>

-- 
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/f064a3c1-d426-4873-b8ba-4cf9ac198a89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to