Method: ExistAPI#get_hits

Defined in:
lib/eXistAPI.rb

#get_hits(handle) ⇒ Object

Get the number of hits in the result-set identified by resultId. example: gethits(handle_id)

  • Args :

    • handle -> Reference to a result-set as returned by a previous call to executeQuery.

  • Returns : -the number of hits

  • Raises :

    • ExistException -> Failed to get number of hits



276
277
278
279
280
281
282
283
284
285
286
# File 'lib/eXistAPI.rb', line 276

def get_hits(handle)
  begin
    summary = @client.call("querySummary", handle)
    hits = summary['hits']
    return hits
  rescue XMLRPC::FaultException => e
    raise e
  rescue
    raise ExistException.new("Failed to get number of hits", 8), caller
  end
end