Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
9405fc17
Commit
9405fc17
authored
Sep 28, 2023
by
jyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rerank
parent
d38eac95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
base.py
api/core/index/base.py
+4
-0
qdrant_vector_index.py
api/core/index/vector_index/qdrant_vector_index.py
+15
-0
No files found.
api/core/index/base.py
View file @
9405fc17
...
...
@@ -54,6 +54,10 @@ class BaseIndex(ABC):
def
delete
(
self
)
->
None
:
raise
NotImplementedError
def
search_by_full_text
(
self
,
query
:
str
,
**
kwargs
:
Any
)
->
List
[
Document
]:
raise
NotImplementedError
def
_filter_duplicate_texts
(
self
,
texts
:
list
[
Document
])
->
list
[
Document
]:
for
text
in
texts
:
doc_id
=
text
.
metadata
[
'doc_id'
]
...
...
api/core/index/vector_index/qdrant_vector_index.py
View file @
9405fc17
...
...
@@ -183,6 +183,21 @@ class QdrantVectorIndex(BaseVectorIndex):
],
))
def
search_by_full_text
(
self
,
query
:
str
,
**
kwargs
:
Any
)
->
List
[
Document
]:
vector_store
=
self
.
_get_vector_store
()
vector_store
=
cast
(
self
.
_get_vector_store_class
(),
vector_store
)
from
qdrant_client.http
import
models
vector_store
.
del_texts
(
models
.
Filter
(
must
=
[
models
.
FieldCondition
(
key
=
"group_id"
,
match
=
models
.
MatchValue
(
value
=
self
.
dataset
.
id
),
),
],
))
def
_is_origin
(
self
):
if
self
.
dataset
.
index_struct_dict
:
class_prefix
:
str
=
self
.
dataset
.
index_struct_dict
[
'vector_store'
][
'class_prefix'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment