mirror of
https://github.com/lancedb/lancedb.git
synced 2026-05-30 02:10:40 +00:00
[Docs] uncomment cosine metric (#271)
- Change k value to `10` for js search to keep it consistent with python docs - Uncomment now that cosine metrix is fixed in lance: https://github.com/lancedb/lance/pull/1035
This commit is contained in:
@@ -79,38 +79,32 @@ await db_setup.createTable('my_vectors', data)
|
||||
const tbl = await db.openTable("my_vectors")
|
||||
|
||||
const results_1 = await tbl.search(Array(1536).fill(1.2))
|
||||
.limit(20)
|
||||
.limit(10)
|
||||
.execute()
|
||||
```
|
||||
|
||||
|
||||
<!-- Commenting out for now since metricType fails for JS on Ubuntu 22.04.
|
||||
|
||||
By default, `l2` will be used as `Metric` type. You can customize the metric type
|
||||
as well.
|
||||
-->
|
||||
|
||||
<!--
|
||||
=== "Python"
|
||||
-->
|
||||
<!-- ```python
|
||||
|
||||
```python
|
||||
df = tbl.search(np.random.random((1536))) \
|
||||
.metric("cosine") \
|
||||
.limit(10) \
|
||||
.to_df()
|
||||
```
|
||||
-->
|
||||
<!--
|
||||
=== "JavaScript"
|
||||
-->
|
||||
|
||||
<!-- ```javascript
|
||||
|
||||
=== "JavaScript"
|
||||
|
||||
```javascript
|
||||
const results_2 = await tbl.search(Array(1536).fill(1.2))
|
||||
.metricType("cosine")
|
||||
.limit(20)
|
||||
.limit(10)
|
||||
.execute()
|
||||
```
|
||||
-->
|
||||
|
||||
|
||||
### Search with Vector Index.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user