Class: Woods::Retriever::RetrievalResult
- Inherits:
-
Struct
- Object
- Struct
- Woods::Retriever::RetrievalResult
- Defined in:
- lib/woods/retriever.rb
Overview
The result of a retrieval operation.
When the caller passed types: to #retrieve, type_rank_context is a Hash keyed by requested type name with one entry per type:
{
"controller" => {
source: :in_top_k, # see enum below
top_of_type_global_rank: 3, # 1-based rank in unfiltered ranked, or nil
global_k: 20, # size of the unfiltered ranked list
total_of_type: 183 # total units of that type in the index
}
}
:source tells the caller which bucket the type landed in without forcing them to infer it from nil ranks:
:in_top_k — type present in the unfiltered ranked list;
strong match.
:within_type_fallback — type NOT in the unfiltered ranked list, but
the fallback vector search returned
candidates of this type. Weak match.
:outside_top_k — type NOT in the unfiltered ranked list, has
units in the index, but the fallback did
not run (other requested types filled the
result). No results of this type.
:absent — type has zero units in the index.
Nil for unfiltered queries.
Instance Attribute Summary collapse
-
#budget ⇒ Object
Returns the value of attribute budget.
-
#classification ⇒ Object
Returns the value of attribute classification.
-
#context ⇒ Object
Returns the value of attribute context.
-
#sources ⇒ Object
Returns the value of attribute sources.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
-
#tokens_used ⇒ Object
Returns the value of attribute tokens_used.
-
#trace ⇒ Object
Returns the value of attribute trace.
-
#type_rank_context ⇒ Object
Returns the value of attribute type_rank_context.
Instance Attribute Details
#budget ⇒ Object
Returns the value of attribute budget
85 86 87 |
# File 'lib/woods/retriever.rb', line 85 def budget @budget end |
#classification ⇒ Object
Returns the value of attribute classification
85 86 87 |
# File 'lib/woods/retriever.rb', line 85 def classification @classification end |
#context ⇒ Object
Returns the value of attribute context
85 86 87 |
# File 'lib/woods/retriever.rb', line 85 def context @context end |
#sources ⇒ Object
Returns the value of attribute sources
85 86 87 |
# File 'lib/woods/retriever.rb', line 85 def sources @sources end |
#strategy ⇒ Object
Returns the value of attribute strategy
85 86 87 |
# File 'lib/woods/retriever.rb', line 85 def strategy @strategy end |
#tokens_used ⇒ Object
Returns the value of attribute tokens_used
85 86 87 |
# File 'lib/woods/retriever.rb', line 85 def tokens_used @tokens_used end |
#trace ⇒ Object
Returns the value of attribute trace
85 86 87 |
# File 'lib/woods/retriever.rb', line 85 def trace @trace end |
#type_rank_context ⇒ Object
Returns the value of attribute type_rank_context
85 86 87 |
# File 'lib/woods/retriever.rb', line 85 def type_rank_context @type_rank_context end |