Skip to content

Commit e4234f4

Browse files
Merge pull request #13 from andreibondarev/adding-remaining-vector-search-params
Adding `bm25:`, `with_hybrid:` to the Get{} query search
2 parents aa5baa4 + bb612cc commit e4234f4

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ client.objects.batch_delete(
172172
near_text = '{ concepts: ["biology"] }'
173173
sort_obj = '{ path: ["category"], order: desc }'
174174
where_obj = '{ path: ["id"], operator: Equal, valueString: "..." }'
175+
with_hybrid = '{ query: "Sweets", alpha: 0.5 }'
175176

176177
client.query.get(
177178
class_name: 'Question',
@@ -187,13 +188,13 @@ client.query.get(
187188
near_text: near_text,
188189

189190
# To use this parameter you must have created your schema by setting the `vectorizer:` property to 'multi2vec-clip' or 'img2vec-neural'
190-
# near_image: ...,
191+
near_image: near_image,
191192

192-
# hybrid: ...,
193+
with_hybrid: with_hybrid,
193194

194-
# bm25: ...,
195+
bm25: bm25,
195196

196-
# near_object: ...,
197+
near_object: near_object,
197198

198199
ask: '{ question: "your-question?" }'
199200
)

lib/weaviate/query.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def get(
1313
near_text: nil,
1414
near_vector: nil,
1515
near_object: nil,
16+
with_hybrid: nil,
17+
bm25: nil,
1618
ask: nil
1719
)
1820
response = client.graphql.execute(
@@ -24,6 +26,8 @@ def get(
2426
near_text: near_text,
2527
near_vector: near_vector,
2628
near_object: near_object,
29+
with_hybrid: with_hybrid,
30+
bm25: bm25,
2731
ask: ask
2832
),
2933
after: after,
@@ -124,6 +128,8 @@ def get_query(
124128
near_text: nil,
125129
near_vector: nil,
126130
near_object: nil,
131+
with_hybrid: nil,
132+
bm25: nil,
127133
ask: nil,
128134
sort: nil
129135
)
@@ -141,6 +147,8 @@ def get_query(
141147
#{near_text.present? ? "nearText: #{near_text}" : ""},
142148
#{near_vector.present? ? "nearVector: #{near_vector}" : ""},
143149
#{near_object.present? ? "nearObject: #{near_object}" : ""},
150+
#{with_hybrid.present? ? "hybrid: #{with_hybrid}" : ""},
151+
#{bm25.present? ? "bm25: #{bm25}" : ""},
144152
#{ask.present? ? "ask: #{ask}" : ""},
145153
#{where.present? ? "where: #{where}" : ""},
146154
#{sort.present? ? "sort: #{sort}" : ""}

0 commit comments

Comments
 (0)