Document known error conditions
- Id
- 8fc089a62c3fb8f97f55b92055ba7219ca553fa5
- Author
- Caio
- Commit time
- 2020-03-22T10:41:13+01:00
Modified tique/src/topterms.rs
impl TopTerms {
/// Creates a new TopTerms that will extract keywords by looking at
/// the given index fields
+ ///
+ /// # Errors
+ ///
+ /// Will yield an error if the provided fields are unknown or if they
+ /// are not `tantivy::schema::TEXT`
pub fn new(index: &Index, fields: Vec<Field>) -> Result<Self> {
let mut field_tokenizers = Vec::new();
Modified tique/src/queryparser/parser.rs
impl QueryParser {
/// Create a QueryParser that knows about the given fields and queries
/// them by default.
+ ///
+ /// # Errors
+ ///
+ /// Will yield an error if any of `fields` is not known by the given
+ /// `index`
pub fn new(index: &Index, fields: Vec<Field>) -> Result<Self> {
let schema = index.schema();