Comments (3)
The 2nd and 3rd operations - both representing "further distance from a query vector" or "furthest neighbors," are currently not supported as indexable operations. Currently the main focus for ANN indexing methods focus on nearest neighbors, not furthest neighbors.
Is there a particular use case you're trying to solve with looking for furthest neighbors? How large is the dataset that you're using, and how big are the vectors?
from pgvector.
Thank you for the quick answer. I was comparing the quality of results of different approaches with the goal to implement a similarity search. Vectors are 768-dimensional, and there are approx. half a million of them.
What's puzzling me is that just using order by vec <#> '[1,2,3']
(and similarly for <=>
) appears to work - they do produce results which looks like "similar" vectors when converted back to text. Am I wrong to interpret the concept of "furthest neighbors" to just "inverse distance ordering" (i.e. to convert furthest neighbors to nearest neighbours, just add "ORDER BY...DESC")?
from pgvector.
Hi @ivoras, to get the nearest neighbors, you should order by just the operator (in ascending order, which is the default).
ORDER BY vec <-> '[1,2,3]'
ORDER BY vec <#> '[1,2,3]'
ORDER BY vec <=> '[1,2,3]'
from pgvector.
Related Issues (20)
- Warning: unknown attribute target_clones HOT 4
- A quick question about length of neighbors for one Element HOT 1
- Fail to Use index query when add order by desc HOT 6
- HNSW index cannot recall any data HOT 7
- Understanding HNSW and IVFFLAT index creation and storage HOT 3
- Make function multiversioning configurable HOT 1
- Lack of result when selecting data without limit
- Support for multiquery? HOT 3
- Cannot install pgvector on windows no matter what is tried. HOT 1
- pgvector Query Time Slower Than ChromaDB and pgvector Not Building HNSW Index on Small Number of Rows HOT 7
- Supported datatypes HOT 4
- vector.so: undefined symbol: _xgetbv HOT 5
- Adding data after building hnsw index is much slower HOT 4
- 【ef_search】set hnsw.ef_search = 1001 failed HOT 2
- Error building Docker image `make: /usr/bin/clang-11: No such file or directory` HOT 2
- ivfflat indexing takes 6-8x longer for halfvec than for vector HOT 5
- configuring the pgVector like an nightmare HOT 1
- Intermittent timeout on getting nearest neighbors by L2 distance
- make 0.7.0 failed HOT 1
- Does pgvector need to be installed in the slave of the pg database in cluster mode? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgvector.