-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add es8 indexer&retriever #41
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license-eye has totally checked 179 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
157 | 22 | 0 | 0 |
Click to see the invalid file list
- components/indexer/es8/field_mapping/consts.go
- components/indexer/es8/field_mapping/field_mapping.go
- components/indexer/es8/internal/consts.go
- components/indexer/es8/consts.go
- components/indexer/es8/indexer.go
- components/indexer/es8/indexer_test.go
- components/indexer/es8/utils.go
- components/retriever/es8/field_mapping/consts.go
- components/retriever/es8/field_mapping/mapping.go
- components/retriever/es8/internal/consts.go
- components/retriever/es8/search_mode/approximate.go
- components/retriever/es8/search_mode/approximate_test.go
- components/retriever/es8/search_mode/dense_vector_similarity.go
- components/retriever/es8/search_mode/dense_vector_similarity_test.go
- components/retriever/es8/search_mode/exact_match.go
- components/retriever/es8/search_mode/interface.go
- components/retriever/es8/search_mode/raw_string.go
- components/retriever/es8/search_mode/sparse_vector_text_expansion.go
- components/retriever/es8/search_mode/sparse_vector_text_expansion_test.go
- components/retriever/es8/search_mode/utils.go
- components/retriever/es8/consts.go
- components/retriever/es8/retriever.go
components/retriever/es8/search_mode/sparse_vector_text_expansion_test.go
Show resolved
Hide resolved
go-test-coverage report:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license-eye has totally checked 174 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
164 | 10 | 0 | 0 |
Click to see the invalid file list
- components/retriever/es8/search_mode/approximate.go
- components/retriever/es8/search_mode/approximate_test.go
- components/retriever/es8/search_mode/dense_vector_similarity.go
- components/retriever/es8/search_mode/dense_vector_similarity_test.go
- components/retriever/es8/search_mode/exact_match.go
- components/retriever/es8/search_mode/raw_string.go
- components/retriever/es8/search_mode/sparse_vector_text_expansion.go
- components/retriever/es8/search_mode/sparse_vector_text_expansion_test.go
- components/retriever/es8/search_mode/utils.go
- components/retriever/es8/option.go
// QueryFieldName the name of query field, required when using Hybrid | ||
QueryFieldName string | ||
// VectorFieldName the name of the vector field to search against, required | ||
VectorFieldName string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QueryFieldName 和 VectorFieldName 分别怎么理解?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QueryFieldName 代表 query 对应的 field 名称
VectorFieldName 代表 query 通过 embedding 生成的 vector 对应的 field 名称
ad8060a
to
1b7e6dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license-eye has totally checked 180 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
179 | 1 | 0 | 0 |
Click to see the invalid file list
- components/retriever/es8/search_mode/raw_string_test.go
1b7e6dd
to
da0e449
Compare
components/indexer/es8/utils.go
Outdated
|
||
var chunks [][]T | ||
for size < len(slice) { | ||
slice, chunks = slice[size:], append(chunks, slice[0:size:size]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slice[0:size:size] 这里 slice 切片时,指定 cap 的用意是啥
components/indexer/es8/indexer.go
Outdated
if err = bi.Add(ctx, item); err != nil { | ||
return nil, err | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方有 bi.Add 进行批量添加, 是不是少一个 执行的步骤?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BulkIndexer 内部会定期 flush,下面的 Close 方法也会 flush
components/indexer/es8/indexer.go
Outdated
tuples := make([]tuple[string, int], 0, len(fields)) | ||
texts := make([]string, 0, len(fields)) | ||
for k, text := range needEmbeddingFields { | ||
tuples = append(tuples, tuple[string, int]{k, len(texts)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tuple 这个语义应该是 pair
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
texts 变量中, 长度为啥使用 fields, 而不是 needEmbeddingFields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len(texts) 表达的是这个 tuple 对应在 texts 中的位置?
components/indexer/es8/indexer.go
Outdated
} | ||
|
||
for _, t := range tuples { | ||
fields[t.A] = vectors[t.B] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原来 fields 中的 value 应该是啥, 是不是不应该更改 fields 这个 map[string]any
components/indexer/es8/indexer.go
Outdated
} | ||
} | ||
|
||
b, err := json.Marshal(fields) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看是否需要把 json 换乘 sonic
No description provided.