Hello,
Let me explain the problem:
- Let's say I have a library, the library contains many books, each book contains chapters, each chapter contains string (and the string begins and ends with dot ".").
- The sequence again, library -> book -> chapter -> string.
- I extracted the strings from books, let's call them "books strings".
- I have a system, where a user can enter a string in the search form, and the system should return the exact match of the entered string from "books strings". If the entered string doesn't match any string from books strings nothing will be returned.
I think about it and found a solution, I'll MD5 all books strings and save the hashed books strings. When a user enters a string to search, I'll hash it too and search for a match in the hashed books strings. It's cheaper (32 or 64 char for each string), faster than plain searching and it only returns the exact match(es).
Do have any comments, ideas, better solutions?
P.S. What is the name of such an algorithm? searching or matching?