Similar Items: Logical compactness and constraint satisfaction problems