L
L
LobsterJoe2019-01-01 14:59:30
symfony
LobsterJoe, 2019-01-01 14:59:30

How to search across multiple Doctrine entities?

Greetings!
There was a need to implement a search among several entities present in the system. For example, there is a user with the fullName property (Ivan Pertov) and an article with the title property (Ivan on the road). That is, for the query "Ivan" I would like to get a result that includes users and articles with this entry.
Tell me which way to dig.
At the moment, I have two suggestions:
The first is to pull the relevant repositories and then merge the result.
The second is to create a separate entity that stores the fields by which the search is carried out, and a link to a specific object, and search already in it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-01-01
@LobsterJoe

Option 3.
Use a special tool. For example elastic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question