When exploring platforms like DnD Insider and the Kindle app, users can efficiently search for specific text strings within a vast amount of text data. If I were to develop a web application that enables users to swiftly search through a "rulebook" (or similar text) for relevant information and display it, how should I structure the data?
I am hesitant about storing all the data in memory. However, if I were to save it in a database, what would be the optimal method for searching the database and retrieving the appropriate information?
At this point, I am considering using the Boyer-Moore algorithm for the search process. I could store different sections of rule-text as separate entries in the database. When conducting a user search, the emphasis will be on scanning section titles rather than the body text. Since the text content will remain static and non-editable by users, perhaps utilizing an array to store each word might prove effective?