Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
metonymic-smokey committed Aug 28, 2024
1 parent 7798b41 commit 0b90c1e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions docs/vectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ if err != nil {
fmt.Println(searchResult.Hits)
```

## Querying with Filters
```go
searchRequest := NewSearchRequest(query.NewMatchNoneQuery())

filterQuery := NewTermQuery("hello")

searchRequest.AddKNNWithFilter(
"vec", // vector field name
[]float32{10,11,12,13,14,15,16,17,18,19}, // query vector (same dims)
5, // k
0, // boost
filterQuery, // filter query
)
searchResult, err := index.Search(searchRequest)
if err != nil {
panic(err)
}
fmt.Println(searchResult.Hits)
```

## Setup Instructions

* Using `cmake` is a recommended approach by FAISS authors.
Expand Down
2 changes: 1 addition & 1 deletion index/scorch/optimize_knn.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type OptimizeVR struct {
}

// This setting _MUST_ only be changed during init and not after.
var BleveMaxKNNConcurrency = 1
var BleveMaxKNNConcurrency = 10

func (o *OptimizeVR) invokeSearcherEndCallback() {
if o.ctx != nil {
Expand Down

0 comments on commit 0b90c1e

Please sign in to comment.