Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!