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

233
Views
How to search posts with an keyword (strings of strings)?

I'm trying to make a search field, and I'm already able to do searches, but it only returns posts that are typed with the same title or are exactly the same which would not be interesting, this happens in my conditional if (query !== post .title && query) return null The ideal would be to search just one word and return similar posts, I've tried using the includes method as follows if (query !== post.title && query.includes(post.title) && query) return null but someone didn't work Would you help me ?

 {(() => {
          if (isLoading) return <LoadingBlock />
          if (!isLoading && postList.length === 0) return <NoDataWarning text='Nenhuma postagem encontrada.' />
          return postList.map((post, index) => {
            if (query !== post.title && query.includes(post.title) && query) return null //the problem is here
            return (
              <PostContainer position={index}>
                <PostBanner />
                <PostInfoContainer>
                  <span>
                    <AiFillCalendar />
                    {new Date(post.createdAt).toLocaleDateString()}
                  </span>
                  <span>
                    <FaUserCircle />
                    {`${post.firstName} ${post.lastName}`}
                  </span>
                </PostInfoContainer>
                <PostTitle>{post.title}</PostTitle>
              </PostContainer>
            )
about 4 years ago · Juan Pablo Isaza
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!