Questions about scripted_field and painless

My first question: Can a scripted_field be used for searching?
Assuming it can, are there performance issues with that?

Does the ArrayList object have Map method (like in javascript)?

I have lift of Gifts stored with in index, and I want to use a scripted_field to get the total amount over a given period.

I've started with this:

int total = 0; for (def gift : ctx._source.Gifts) { total+=gift.Amount} return total

But I keep keep getting a null reference exception. Same thing when I tried without the ctx

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.