rough pass at implementing search on index