{"record":{"id":"926615ddec4b2b40","repo":"ankane/searchkick","slug":"query-error-use-the-error-method-to-view-it","errorCode":null,"errorMessage":"Query error - use the error method to view it","messagePattern":"Query error - use the error method to view it","errorType":"exception","errorClass":"Searchkick::Error","httpStatus":null,"severity":"error","filePath":"lib/searchkick/results.rb","lineNumber":140,"sourceCode":"    def next_page\n      current_page < total_pages ? (current_page + 1) : nil\n    end\n\n    def first_page?\n      previous_page.nil?\n    end\n\n    def last_page?\n      next_page.nil?\n    end\n\n    def out_of_range?\n      current_page > total_pages\n    end\n\n    def hits\n      if error\n        raise Error, \"Query error - use the error method to view it\"\n      else\n        @response[\"hits\"][\"hits\"]\n      end\n    end\n\n    def highlights(multiple: false)\n      hits.map do |hit|\n        hit_highlights(hit, multiple: multiple)\n      end\n    end\n\n    def with_highlights(multiple: false)\n      return enum_for(:with_highlights, multiple: multiple) unless block_given?\n\n      with_hit.each do |result, hit|\n        yield result, hit_highlights(hit, multiple: multiple)\n      end\n    end","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/ankane/searchkick/blob/93e901a75b11a25101668a616e006b158251b16e/lib/searchkick/results.rb#L122-L158","documentation":"Error \"Query error - use the error method to view it\" thrown in ankane/searchkick.","triggerScenarios":"Thrown at lib/searchkick/results.rb:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e901a75b11a25101668a616e006b158251b16e","analyzedAt":"2026-08-21T19:06:23.767Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}