title: Search api prisma mysql where ANY
body: <p>I'm trying to implement search api for my project. However I'm not sure how to accomplish this task whenever I got many variables which need to be included into query. For example how can I search for ANY character using this piece of code?</p>
  <pre><code>jobs = await prisma.jobOffer.findMany({
              where: {
                  OR: [
                      {
                          title: {
                              search: searchTerm?.replace(' ', ' | ') || undefined
                          }
                      },
                      {
                          description: {
                              search: searchTerm?.replace(' ', ' | ') || undefined
                          }
                      }
                  ]
              },
              include: {
                  category: true,
                  company: true
              }
          })
  </code></pre>
  <p>UPDATE:
  as stated in <a href="https://www.prisma.io/docs/concepts/components/prisma-client/null-and-undefined#the-effect-of-null-and-undefined-on-conditionals" rel="nofollow noreferrer">docs</a>, OR returns no results if undefined. On the other hand, AND returns all results if undefined, so I took this approach:</p>
  <pre><code>jobs = await prisma.jobOffer.findMany({
          where: {
              AND: [ 
                     {
                         OR: [
                              {
                                  title: {
                                      search: searchTerm?.replace(' ', ' | ') || undefined
                                  }
                              },
                              {
                                   description: {
                                            search: searchTerm?.replace(' ', ' | ') || undefined
                                   }
                              }
                          ]
                     }
                   ]
          },
          include: {
              category: true,
              company: true
          }
      })
  </code></pre>