Merge pull request #1136 from tantivy-search/minor_fixes

more docs detail
This commit is contained in:
PSeitz
2021-08-13 18:11:47 +01:00
committed by GitHub
4 changed files with 10 additions and 14 deletions

View File

@@ -109,17 +109,11 @@ impl FieldEntry {
&self.field_type
}
/// Returns true iff the field is indexed
/// Returns true iff the field is indexed.
///
/// An indexed field is searchable.
pub fn is_indexed(&self) -> bool {
match self.field_type {
FieldType::Str(ref options) => options.get_indexing_options().is_some(),
FieldType::U64(ref options)
| FieldType::I64(ref options)
| FieldType::F64(ref options)
| FieldType::Date(ref options) => options.is_indexed(),
FieldType::HierarchicalFacet(ref options) => options.is_indexed(),
FieldType::Bytes(ref options) => options.is_indexed(),
}
self.field_type.is_indexed()
}
/// Returns true iff the field is a int (signed or unsigned) fast field

View File

@@ -20,7 +20,7 @@ pub const STORED: SchemaFlagList<StoredFlag, ()> = SchemaFlagList {
#[derive(Clone)]
pub struct IndexedFlag;
/// Flag to mark the field as indexed.
/// Flag to mark the field as indexed. An indexed field is searchable.
///
/// The `INDEXED` flag can only be used when building `IntOptions` (`u64`, `i64` and `f64` fields)
/// Of course, text fields can also be indexed... But this is expressed by using either the

View File

@@ -29,7 +29,7 @@ impl IntOptions {
self.stored
}
/// Returns true iff the value is indexed.
/// Returns true iff the value is indexed and therefore searchable.
pub fn is_indexed(&self) -> bool {
self.indexed
}
@@ -52,6 +52,8 @@ impl IntOptions {
///
/// Setting an integer as indexed will generate
/// a posting list for each value taken by the integer.
///
/// This is required for the field to be searchable.
pub fn set_indexed(mut self) -> IntOptions {
self.indexed = true;
self

View File

@@ -94,7 +94,7 @@ impl TextFieldIndexing {
}
}
/// The field will be untokenized and indexed
/// The field will be untokenized and indexed.
pub const STRING: TextOptions = TextOptions {
indexing: Some(TextFieldIndexing {
tokenizer: Cow::Borrowed("raw"),
@@ -103,7 +103,7 @@ pub const STRING: TextOptions = TextOptions {
stored: false,
};
/// The field will be tokenized and indexed
/// The field will be tokenized and indexed.
pub const TEXT: TextOptions = TextOptions {
indexing: Some(TextFieldIndexing {
tokenizer: Cow::Borrowed("default"),