What will be an efficient way to increase the speed of your search engine that does not use lucene?
===

I have a problem here.I have a search engine that i implemented in java and something is not right.I use a database to save the inverted index and then when later when i update the corpus(by uploading a document) . the ideal way should be to update this database and update the document vectors of each of the document(used for query matching).Now the point is when i do that,it is taking forever to form the vectors(>10k dimensions).I do this by reading each term from the database , and put tf-idf value for that term , if it exists in that document and a 0.0 if it doesn't.I think i need an efficient way to re-make document vectors because almost>9k vectors will remain unchanged because a new document adds >100 terms in a corpus.
I'm really messed up. Can i get some help?

Thank you 