Add similarity indexing and entity api