rewrite core search engine to use sqlite improving performance by over 10x