In our desktop application, we implemented a simple search engine using an inverted index .
Unfortunately, some of our users' datasets can be very large, for example. occupying ~ 1 GB of memory before the inverted index was created. An inverted index by itself takes up most of the memory, almost as much as indexed data (another 1 GB of RAM).
Obviously, this creates problems with memory errors, since the 32-bit Windows limit of 2 GB of memory per application falls, or users with smaller computers are trying to cope with the memory requirement.
Our inverted index is saved as:
Dictionary<string, List<ApplicationObject>>
And this is created during data loading, when each object is processed in such a way that the applicationObject keyword string and description words are stored in an inverted index.
So my question is: is it possible to maintain a search index more efficiently spatially? Perhaps you need to use a different structure or strategy? Alternatively, you can create a kind of CompressedDictionary? Since it stores a lot of lines, I expect it to be highly compressible.
optimization c # memory search search-engine
Rickl
source share