Hi All, 

I am trying to run a faceted query with a custom script on the facet value. 
I need to pass a "map" of values into the script with params. Below id my 
*script*, 

"*value_script*":"( iid1= new String(doc['itemid1'].value) ;r = 
doc['similarity'].value * srcVals.containsKey(iid1) ? srcVals.get(iid1): -1 
; return r )"

For some reason, my *containsKey* returns true but get on the map results 
in a *nullpointer* exception. 

I pass params as :

"*params*": { "srcVals": sources  }

Where sources is a python dict. example dict is:

{'3058211': '3', '3473092': '4', '3097044': '3', '2491239': '4', '2371363': 
'4', '3049884': '5', '2212351': '4', '3064057': '3'}

As you can see, i need to get a number associated with some other number. I 
pass the association as a param. but accessing the param is returning a 
nullpointer. 

Thanks!
Ravi

-- 
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/31746a14-4c9c-4fe3-b8f2-c59947f31706%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to