Reporting back search results via email


(X Calibur) #1

Hi,

Is it possible to configure a Watcher to attach the search query results to the email once it's fired?

Thanks


(Alexander Reelsen) #2

Hey,

yes, you can just iterate through the search hits in the body of an email action. Results would be available in ctx.payload.hits.hits if you only have one search input.

You might want to check out this blog post how to efficiently write and debug watches, it should shorten your testing cycles -I know it's pretty long, but worth it (spoiler: I wrote it, I might be biased :slight_smile:

--Alex


(X Calibur) #3

Hi Alex,

thanks for the reply.
Is there a more specific example for iterating through the search hits?
I got kind of lost in your blog post...

Thanks
X


(system) #4

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