Skip to content
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

added autocut parameter to Query.get #32

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/weaviate/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def get(
after: nil,
tenant: nil,
limit: nil,
autocut: nil,
offset: nil,
sort: nil,
where: nil,
Expand All @@ -24,6 +25,7 @@ def get(
class_name: class_name,
tenant: tenant,
fields: fields,
autocut: autocut,
sort: sort,
where: where,
near_text: near_text,
Expand Down Expand Up @@ -85,6 +87,8 @@ def explore(
response = client.graphql.execute(
explore_query(
fields: fields,
sort: sort,
where: where,
near_text: near_text,
near_vector: near_vector,
near_image: near_image,
Expand Down Expand Up @@ -121,7 +125,7 @@ def explore_query(
#{near_text.present? ? "nearText: #{near_text}" : ""},
#{near_vector.present? ? "nearVector: #{near_vector}" : ""},
#{near_image.present? ? "nearImage: #{near_image}" : ""},
#{near_object.present? ? "nearObject: #{near_object}" : ""}
#{near_object.present? ? "nearObject: #{near_object}" : ""},
#{where.present? ? "where: #{where}" : ""},
#{sort.present? ? "sort: #{sort}" : ""}
) {
Expand All @@ -133,7 +137,9 @@ def explore_query(

def get_query(
class_name:,
fields:, tenant: nil,
fields:,
autocut:,
tenant: nil,
where: nil,
near_text: nil,
near_vector: nil,
Expand All @@ -155,7 +161,8 @@ def get_query(
after: $after,
limit: $limit,
offset: $offset,
#{tenant.present? ? "tenant: #{tenant}" : ""}
#{autocut.present? ? "autocut: #{autocut}" : ""},
#{tenant.present? ? "tenant: #{tenant}" : ""},
#{near_text.present? ? "nearText: #{near_text}" : ""},
#{near_vector.present? ? "nearVector: #{near_vector}" : ""},
#{near_image.present? ? "nearImage: #{near_image}" : ""},
Expand Down