How to test Elasticsearch search?

Hi,

I’m trying to test very basic search feature in Elasticsearch

you can find all the code and the test in this gist

This is part of a take home challenge with a company I would love to work with, I have implemented the full feature, the tests are a BOUNCE :smiling_face::moneybag:

another thing I’m stuck at, is how to handle requests if the application is distributed along multiple servers, I have done my search and -theoretically- I think I know how to do it, well it needs a Redis stream with a timestamp for each request across servers and another one to push the jobs out of it, and thats pretty much what I know :melting_face:.

Appreciate your help and knowledge

I’m not sure if there is a better solution for your last point, about how to distribute search, queries across multiple hosts, but I think you were on the right track thinking about Redis. More specifically, you could look into a message queue system, like Kafka, that receive all query requests allow systems that can respond to those queries to pull the next query to perform from the queue.

There is an inherent amount of indirection in this process, so perhaps there is a simpler way to achieve this that could be worth investigating before moving to a more complicated message queuing system.