Module: Swiftype::Client::Domain

Included in:
Swiftype::Client
Defined in:
lib/swiftype/client.rb

Overview

A Domain represents a host in a crawler-based Engine. Domains are only relevant to crawler-base engines, but you can manipulate them through the REST API.

Instance Method Summary collapse

Instance Method Details

#crawl_url(engine_id, domain_id, url) ⇒ Object

Request to add or update a URL on a Domain. The host of the URL must match the host of the Domain.

Parameters:

  • engine_id (String)

    the Engine slug or ID

  • domain_id (String)

    the Domain ID

  • url (String)

    the URL to crawl


486
487
488
# File 'lib/swiftype/client.rb', line 486

def crawl_url(engine_id, domain_id, url)
  put("engines/#{engine_id}/domains/#{domain_id}/crawl_url.json", {:url => url})
end

#create_domain(engine_id, url) ⇒ Object


468
469
470
# File 'lib/swiftype/client.rb', line 468

def create_domain(engine_id, url)
  post("engines/#{engine_id}/domains.json", {:domain => {:submitted_url => url}})
end

#destroy_domain(engine_id, domain_id) ⇒ Object


472
473
474
# File 'lib/swiftype/client.rb', line 472

def destroy_domain(engine_id, domain_id)
  delete("engines/#{engine_id}/domains/#{domain_id}.json")
end

#domain(engine_id, domain_id) ⇒ Object


464
465
466
# File 'lib/swiftype/client.rb', line 464

def domain(engine_id, domain_id)
  get("engines/#{engine_id}/domains/#{domain_id}.json")
end

#domains(engine_id) ⇒ Object


460
461
462
# File 'lib/swiftype/client.rb', line 460

def domains(engine_id)
  get("engines/#{engine_id}/domains.json")
end

#recrawl_domain(engine_id, domain_id) ⇒ Object

Trigger a recrawl request for a Domain. Note that this will fail if you have exceeded your recrawl limit.


477
478
479
# File 'lib/swiftype/client.rb', line 477

def recrawl_domain(engine_id, domain_id)
  put("engines/#{engine_id}/domains/#{domain_id}/recrawl.json")
end