PGvector

2023-12-30  本文已影响0人  何亮hook_8285
#sql语句
select * from (SELECT id,features,1 - (features <-> ?) as similarity FROM items ORDER BY features <-> ? LIMIT 5) as faces where faces.similarity between 0.8 and 1.0 
#jdbc
 <dependency>
            <groupId>com.pgvector</groupId>
            <artifactId>pgvector</artifactId>
            <version>0.1.3</version>
        </dependency>
        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
            <version>5.8.16</version>
        </dependency>
上一篇下一篇

猜你喜欢

热点阅读