I am writing an application to be used as a local disc documents store similar functionality to Firebase or MongoDB. The gist of how it works is a column hash table. For example:
Say I have a user document
{
"first": "stack",
"last": "overflow",
"age": 2147
}
I basically iterate each field as a column and save a hashed value as a filename for a file, that contains the unique row key(if multiple objects have the same value for a column there will be multiple row keys written to the file). Then save record in a directory with the key as the filename. So for a simple name = "stack" I have an O(1) lookup, hash the value, see if a file exists with the hashed value as a name, if exists, read all row keys from file. iterate each key and load data from file. I guess if the number of rows is large this will be a slower query.
What I am trying to do
I want to ad a partial text search capability. My initial idea is to write all permutations of the value into the index and then do the same O(1) - file exists - check that I mentioned above. So if the query is name name contains st
I will just look a filename for that value and read all rows keys.
Is this a good way to offer a partial text search? What are some common industry techniques?