I hope you already solved it, but in case it's usefull:
I wouldn't store the whole PDFs on a table. I'ld rather take a fixed (or variable but limited) quantity of keywords instead. This process takes two stages when the user uploads the PDF:
1: Extract the whole text as plaintext. If the PDF is in a readable format, then use any library out there for this. Eg: https://github.com/spatie/pdf-to-text
If there are just text images, like a scanned book for example, things gets more interesting. I would use Google Vision OCR API to extract text from images first.
Google Vision OCR link: https://cloud.google.com/vision/docs/ocr
2: Extract keywords from text. Definitively I would use Google's Natural Language API. It's AI powered, accepts text as an imput and returns the keywords , subjects , categories , of a text letting you know what it's about, with confidence percentage for each tag.
Google Natural Language API link: https://cloud.google.com/natural-language/
DB design: I'ld use a single pdf_contents table , with two or three columns: pdf_path ( VARCHAR your download link), keywords (a TEXT field) categories (TEXT field, if Google is able to clasify the text).
Then the query would just be :
SELECT UNIQUE path FROM pdf_contents WHERE keywords LIKE %{searchword}% OR categories LIKE %{search word}% LIMIT N;
EDIT: forgot to put the link to a pdf to text example library on PHP