#[non_exhaustive]pub struct SearchParams {Show 26 fields
pub query: Option<String>,
pub sources: Option<Vec<String>>,
pub opt_in_sources: Option<Vec<String>>,
pub exclude_sources: Option<Vec<String>>,
pub source_types: Option<Vec<SourceType>>,
pub exclude_source_types: Option<Vec<SourceType>>,
pub from: Option<DateInput>,
pub to: Option<DateInput>,
pub languages: Option<Vec<String>>,
pub tickers: Option<Vec<String>>,
pub countries: Option<Vec<String>>,
pub categories: Option<Vec<String>>,
pub has_content: Option<bool>,
pub roles: Option<Vec<CompanyRole>>,
pub min_relevance: Option<f64>,
pub event_types: Option<Vec<EventType>>,
pub event_directions: Option<Vec<EventDirection>>,
pub min_importance: Option<Importance>,
pub sectors: Option<Vec<String>>,
pub company_countries: Option<Vec<String>>,
pub exchanges: Option<Vec<String>>,
pub order_by: Option<OrderBy>,
pub order: Option<SortOrder>,
pub limit: Option<u32>,
pub cursor: Option<String>,
pub include: Option<Vec<IncludeBlock>>,
}Expand description
Parameters of articles().search() and articles().search_all().
use finlight::{IncludeBlock, SearchParams};
let params = SearchParams::new()
.query("ticker:NVDA")
.languages(["en"])
.include([IncludeBlock::COMPANIES, IncludeBlock::EVENTS])
.limit(10);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.query: Option<String>Query language, e.g. ticker:AAPL AND eventType:earnings.
sources: Option<Vec<String>>Only these source domains.
opt_in_sources: Option<Vec<String>>Non-default sources added to the default pool.
exclude_sources: Option<Vec<String>>Source domains left out.
source_types: Option<Vec<SourceType>>Only sources of these types. Articles of unclassified sources never match.
exclude_source_types: Option<Vec<SourceType>>Source types left out. Articles of unclassified sources are kept.
from: Option<DateInput>Lower bound of the order_by timestamp.
to: Option<DateInput>Upper bound of the order_by timestamp.
languages: Option<Vec<String>>ISO 639-1 codes; not empty. The server default is ["en"].
tickers: Option<Vec<String>>Tickers (SYMBOL, SYMBOL@MIC, vendor notations).
countries: Option<Vec<String>>Geographic focus of the story (ISO alpha-2).
categories: Option<Vec<String>>Categories.
has_content: Option<bool>true keeps only articles with scraped content.
roles: Option<Vec<CompanyRole>>Company roles (same company as tickers and min_relevance).
min_relevance: Option<f64>Minimum relevance, 0 to 1.
event_types: Option<Vec<EventType>>Event types (same event as event_directions and min_importance).
event_directions: Option<Vec<EventDirection>>Event directions.
min_importance: Option<Importance>Minimum event importance.
sectors: Option<Vec<String>>GICS sectors.
company_countries: Option<Vec<String>>Company domicile (ISO alpha-2).
exchanges: Option<Vec<String>>Primary-listing MICs.
order_by: Option<OrderBy>Sort timestamp (and the timestamp from and to apply to).
order: Option<SortOrder>Sort direction.
limit: Option<u32>Page size, 1 to 100. The server default is 20.
cursor: Option<String>pagination.next_cursor of the previous page.
include: Option<Vec<IncludeBlock>>Extra blocks (at most 3).
Implementations§
Source§impl SearchParams
impl SearchParams
Sourcepub fn from_json(json: &str) -> Result<Self>
pub fn from_json(json: &str) -> Result<Self>
Reads parameters from a JSON object with the wire keys (eventTypes, orderBy, …).
An unknown key is rejected with Error::Validation naming it.
Sourcepub fn opt_in_sources<I, S>(self, values: I) -> Self
pub fn opt_in_sources<I, S>(self, values: I) -> Self
Non-default sources added to the default pool.
Sourcepub fn exclude_sources<I, S>(self, values: I) -> Self
pub fn exclude_sources<I, S>(self, values: I) -> Self
Source domains left out.
Sourcepub fn categories<I, S>(self, values: I) -> Self
pub fn categories<I, S>(self, values: I) -> Self
Categories.
Sourcepub fn company_countries<I, S>(self, values: I) -> Self
pub fn company_countries<I, S>(self, values: I) -> Self
Company domicile countries.
Sourcepub fn source_types<I, S>(self, values: I) -> Self
pub fn source_types<I, S>(self, values: I) -> Self
Only sources of these types (SourceType::NEWSWIRE, …).
Sourcepub fn exclude_source_types<I, S>(self, values: I) -> Self
pub fn exclude_source_types<I, S>(self, values: I) -> Self
Source types left out.
Sourcepub fn event_types<I, S>(self, values: I) -> Self
pub fn event_types<I, S>(self, values: I) -> Self
Event types.
Sourcepub fn event_directions<I, S>(self, values: I) -> Self
pub fn event_directions<I, S>(self, values: I) -> Self
Event directions.
Sourcepub fn has_content(self, value: bool) -> Self
pub fn has_content(self, value: bool) -> Self
Only articles with scraped content.
Sourcepub fn from(self, value: impl Into<DateInput>) -> Self
pub fn from(self, value: impl Into<DateInput>) -> Self
Lower bound (a SystemTime, DateInput::date(..) or a string).
Sourcepub fn min_relevance(self, value: f64) -> Self
pub fn min_relevance(self, value: f64) -> Self
Minimum relevance, 0 to 1.
Sourcepub fn min_importance(self, value: impl Into<Importance>) -> Self
pub fn min_importance(self, value: impl Into<Importance>) -> Self
Minimum event importance.