3
I’m thinking of the following idea: Use Elasticsearch features to make complex searches instead of making direct queries to Mysql using many where
. If I were to use MYSQL I would have to create many indexes.
So when I give one insert
in my table I will also put the record in Elasticsearch, would make this complex query in Elasticserch and take the id
's to then query Mysql using for example:
SELECT * FROM table WHERE id IN (1,4,8,9,21,54,87,...)
That would be feasible?
is using some programming language in the middle?
– gmsantos
Yes, I am using PHP, with Laravel 5.1 framework
– rodrigoum
You can then try to break into two parts your logic, in the first part make the query in Elastic and by Laravel use the
whereIn
of Eloquent– gmsantos
gmsants, that’s what I said in the question. I wonder if this is a good approach, if it would be worth doing so.
– rodrigoum
I believe so. I don’t know Elasticsearch very well yet, I intend to study it in a few weeks. So I don’t risk leaving any answers for now.
– gmsantos
Look, it seems to me a great waste of resources. Elastic Search can now return everything you need, you should not search twice.
– Thiago Lunardi