Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

233
Vistas
How to search for data in many tables?

How to search data in all tables from my database? I need to create some sort of search like is on Github where after entering the phrase into the search engine, it looks for us both repositories, issues and users, I need to do something like this but with searching in entities like: User, Order and Projects,

I'm using TypeORM and simple search query looks like below:

const data = await this.conn
      .getRepository(Order)
      .createQueryBuilder('order')
      .where('order.name = :name ', { name : name })
      .leftJoin('order.author', 'author')
      .orderBy('order.lastUpdate', 'DESC');

but how to search not only in Order entity but also in other tables like User and Projects? How the biggest company search engine works?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Big companies such as google base their technologies on AI now, using them as a system to organise Big Data (see more on that here). However, google originally used the Page Rank algorithm that would assign higher values to websites that had high referral rates from other sites (see here).

It sounds like what you would get the most from is the LIKE keyword (see the basics) in combination with the UNION keyword (info here).

You could probably get some good results with something like this in SQL (I dont know TypeORM):

SELECT * FROM table1 WHERE name LIKE '%searchterm%'
UNION
SELECT * FROM table2 WHERE name LIKE '%searchterm%';
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda