write relational indexing and similarity