Sravan
Sravan

Reputation: 553

How to save and load a giant hash-table to-n-fro from disk?

I am trying to write a search-engine for a large collection, for learning purposes. I started with my own intuitions. Then I researched and am finally arriving at a working model.

I am constructing a giant hash-table to hold all the terms in my collection. It is very expensive to construct this from the collection. Once I have computed the table I want to save this to disk, so that whenever I want to access this hash-table in my program latter, I can load it again from disk.

Is there any standard way of doing it or do I have to invent my own file-format and hacks to do this?

Note: The has-table is only for storing all term occurrences, I am planning to store the main ranking data in a postings file and have its pointer set in corresponding term of hash-table.

I am working in C.

Upvotes: 2

Views: 679

Answers (1)

phs
phs

Reputation: 11061

BDB is a library for efficiently managing flat-file databases. In particular a hash table format is supported. B-Trees are also available, in case ordered access is required.

Upvotes: 1

Related Questions