knnsearch v1 framework implementation(not finished yet)