When you are not able to find a lib that provides the functions you need within delphi, create a webservice and call that from delphi.
Also COM server could be a solution for you, when you do not like http.
I really suggest to use a library that does the work for you.
To name at least one: Lucene
If you want to use some server software, use elastic search or the build in fulltext catalogs in sql databases.