Class: Ecfr::SearchService::ContentVersion

Inherits:
Base show all
Defined in:
lib/ecfr/search_service/content_version.rb,
lib/ecfr/search_service/content_version/count.rb,
lib/ecfr/search_service/content_version/result.rb,
lib/ecfr/search_service/content_version/summary.rb,
lib/ecfr/search_service/content_version/suggestion.rb,
lib/ecfr/search_service/content_version/hierarchical_count.rb,
lib/ecfr/search_service/content_version/hierarchichal_result.rb,
lib/ecfr/search_service/content_version/hierarchical_count_node.rb

Direct Known Subclasses

HierarchicalResult, Result, Suggestion, Summary

Defined Under Namespace

Classes: Count, HierarchicalCount, HierarchicalCountNode, HierarchicalResult, Result, Suggestion, Summary

Constant Summary

Constants inherited from Base

Base::SUPPORTED_ARRAY_ACCESSORS

Instance Attribute Summary

Attributes inherited from Base

#metadata, #request_data, #response_status, #results

Class Method Summary collapse

Methods inherited from Base

base_url, service_name, service_path

Methods inherited from Base

basic_auth_client_options, #each, #initialize, metadata, metadata_key, result_key

Methods included from Extensible

#inherited

Methods included from AttributeMethodDefinition

included, #initialize

Methods inherited from Client

build, cache_key, client, client_pool, delete, execute, get, handle_response, perform, post, purge

Methods included from ParallelClient

included

Constructor Details

This class inherits a constructor from Ecfr::Base

Class Method Details

.count(args) ⇒ <Count>

Metadata about the number of matching items

Parameters:

Returns:

  • (<Count>)

    count metadata



17
18
19
# File 'lib/ecfr/search_service/content_version.rb', line 17

def self.count(args)
  lookup(Ecfr::SearchService::ContentVersion::Count).find(args)
end

.hierarchical_search(args) ⇒ <HierarchicalSearchCount>

Search results in a hierarchical format with score data

Parameters:

Returns:

  • (<HierarchicalSearchCount>)

    hierarchical search results



28
29
30
31
32
# File 'lib/ecfr/search_service/content_version.rb', line 28

def self.hierarchical_search(args)
  lookup(
    Ecfr::SearchService::ContentVersion::HierarchicalResult
  ).find(args)
end

.search(args) ⇒ <Result>

Search results with excerpts and score data

Parameters:

Returns:

  • (<Result>)

    results of a search



41
42
43
# File 'lib/ecfr/search_service/content_version.rb', line 41

def self.search(args)
  lookup(Ecfr::SearchService::ContentVersion::Result).find(args)
end

.suggestions(args) ⇒ <Suggestion>

Suggestions based on the content of a search. Currently suggests direct link to a portion of the CFR when a CFR citation is detected as part of the ‘query`

Parameters:

Returns:



54
55
56
# File 'lib/ecfr/search_service/content_version.rb', line 54

def self.suggestions(args)
  lookup(Ecfr::SearchService::ContentVersion::Suggestion).find(args)
end

.summary(args) ⇒ <Summary>

Summary of the search based on the arguments provided

  • summary only makes use of the :hierarchy and :query

args currenly

Parameters:

Returns:

  • (<Summary>)

    A descriptive summary of the search



67
68
69
# File 'lib/ecfr/search_service/content_version.rb', line 67

def self.summary(args)
  lookup(Ecfr::SearchService::ContentVersion::Summary).find(args)
end