Skip to content

Commit 5f18963

Browse files
jmksbrunoocasali
authored andcommitted
Check attributes when searching an index
1 parent 836f03b commit 5f18963

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/meilisearch/index.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,11 @@ def delete_all_documents!
221221
### SEARCH
222222

223223
def search(query, options = {})
224-
parsed_options = Utils.transform_attributes({ q: query.to_s }.merge(options.compact))
224+
attributes = { q: query.to_s }.merge(options.compact)
225225

226+
Utils.warn_on_non_conforming_attribute_names(attributes)
227+
228+
parsed_options = Utils.transform_attributes(attributes)
226229
response = http_post "/indexes/#{@uid}/search", parsed_options
227230

228231
response['nbHits'] ||= response['estimatedTotalHits'] unless response.key?('totalPages')

0 commit comments

Comments
 (0)