Skip to content

Commit c4acaf8

Browse files
committed
refactor: add search_title method
1 parent 15c01f0 commit c4acaf8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

videodb/collection.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,6 @@ def search(
106106
score_threshold: Optional[float] = None,
107107
dynamic_score_percentage: Optional[float] = None,
108108
) -> SearchResult:
109-
if search_type == SearchType.llm:
110-
search_data = self._connection.post(
111-
path=f"{ApiPath.collection}/{self.id}/{ApiPath.search}/{ApiPath.title}",
112-
data={
113-
"query": query,
114-
"search_type": search_type,
115-
},
116-
)
117-
return [
118-
Video(self._connection, **result.get("video")) for result in search_data
119-
]
120-
121109
search = SearchFactory(self._connection).get_search(search_type)
122110
return search.search_inside_collection(
123111
collection_id=self.id,
@@ -129,6 +117,18 @@ def search(
129117
dynamic_score_percentage=dynamic_score_percentage,
130118
)
131119

120+
def search_title(self, query) -> List[Video]:
121+
search_data = self._connection.post(
122+
path=f"{ApiPath.collection}/{self.id}/{ApiPath.search}/{ApiPath.title}",
123+
data={
124+
"query": query,
125+
"search_type": SearchType.llm,
126+
},
127+
)
128+
return [
129+
Video(self._connection, **result.get("video")) for result in search_data
130+
]
131+
132132
def upload(
133133
self,
134134
file_path: str = None,

0 commit comments

Comments
 (0)