I have a bunch of files in a folder. Let's assume I convert all into plain text files.
I want to use python to perform searches like this:
query = '(word1 and word2) or (word3 and not word4)'
the actual logc varies, and multiple words can be used together. Another example:
query = '(shiny and glass and "blue car")'
Also the words are provided by the users so they are variables.
I want to display the sentences that matched and the filenames.
This really does not need a complex search engine like whoosh or haystack which need to index files with fields.
Also, those tools do not seem to have a boolean query as I explained above.
I've come across pdfquery
library which does exactly what I want for pdfs, but now I need that for text files and xml files.
Any suggestions?