diff --git a/common/src/bitset.rs b/common/src/bitset.rs index 0f1ccb730..bbc74c995 100644 --- a/common/src/bitset.rs +++ b/common/src/bitset.rs @@ -277,7 +277,7 @@ impl BitSet { self.tinyset(el / 64u32).contains(el % 64) } - /// Returns the first non-empty `TinySet` associated to a bucket lower + /// Returns the first non-empty `TinySet` associated with a bucket lower /// or greater than bucket. /// /// Reminder: the tiny set with the bucket `bucket`, represents the diff --git a/doc/src/basis.md b/doc/src/basis.md index 9d16a1703..600093a2e 100644 --- a/doc/src/basis.md +++ b/doc/src/basis.md @@ -50,7 +50,7 @@ to get tantivy to fit your use case: *Example 1* You could for instance use hadoop to build a very large search index in a timely manner, copy all of the resulting segment files in the same directory and edit the `meta.json` to get a functional index.[^2] -*Example 2* You could also disable your merge policy and enforce daily segments. Removing data after one week can then be done very efficiently by just editing the `meta.json` and deleting the files associated to segment `D-7`. +*Example 2* You could also disable your merge policy and enforce daily segments. Removing data after one week can then be done very efficiently by just editing the `meta.json` and deleting the files associated with segment `D-7`. ## Merging diff --git a/examples/deleting_updating_documents.rs b/examples/deleting_updating_documents.rs index 57891d1bc..167e3614f 100644 --- a/examples/deleting_updating_documents.rs +++ b/examples/deleting_updating_documents.rs @@ -113,7 +113,7 @@ fn main() -> tantivy::Result<()> { // on its id. // // Note that `tantivy` does nothing to enforce the idea that - // there is only one document associated to this id. + // there is only one document associated with this id. // // Also you might have noticed that we apply the delete before // having committed. This does not matter really... diff --git a/examples/iterating_docs_and_positions.rs b/examples/iterating_docs_and_positions.rs index 1cb3dad56..8f718cf97 100644 --- a/examples/iterating_docs_and_positions.rs +++ b/examples/iterating_docs_and_positions.rs @@ -44,7 +44,7 @@ fn main() -> tantivy::Result<()> { // A segment contains different data structure. // Inverted index stands for the combination of // - the term dictionary - // - the inverted lists associated to each terms and their positions + // - the inverted lists associated with each terms and their positions let inverted_index = segment_reader.inverted_index(title)?; // A `Term` is a text token associated with a field. @@ -105,7 +105,7 @@ fn main() -> tantivy::Result<()> { // A segment contains different data structure. // Inverted index stands for the combination of // - the term dictionary - // - the inverted lists associated to each terms and their positions + // - the inverted lists associated with each terms and their positions let inverted_index = segment_reader.inverted_index(title)?; // This segment posting object is like a cursor over the documents matching the term. diff --git a/fastfield_codecs/src/column.rs b/fastfield_codecs/src/column.rs index b40f76b69..2962472f9 100644 --- a/fastfield_codecs/src/column.rs +++ b/fastfield_codecs/src/column.rs @@ -4,7 +4,7 @@ use std::ops::RangeInclusive; use tantivy_bitpacker::minmax; pub trait Column: Send + Sync { - /// Return the value associated to the given idx. + /// Return the value associated with the given idx. /// /// This accessor should return as fast as possible. /// diff --git a/src/collector/custom_score_top_collector.rs b/src/collector/custom_score_top_collector.rs index 5c97f5384..54d42469e 100644 --- a/src/collector/custom_score_top_collector.rs +++ b/src/collector/custom_score_top_collector.rs @@ -38,7 +38,7 @@ pub trait CustomSegmentScorer: 'static { pub trait CustomScorer: Sync { /// Type of the associated [`CustomSegmentScorer`]. type Child: CustomSegmentScorer; - /// Builds a child scorer for a specific segment. The child scorer is associated to + /// Builds a child scorer for a specific segment. The child scorer is associated with /// a specific segment. fn segment_scorer(&self, segment_reader: &SegmentReader) -> crate::Result; } diff --git a/src/collector/facet_collector.rs b/src/collector/facet_collector.rs index 9020cf297..543996721 100644 --- a/src/collector/facet_collector.rs +++ b/src/collector/facet_collector.rs @@ -91,7 +91,7 @@ fn facet_depth(facet_bytes: &[u8]) -> usize { /// let index = Index::create_in_ram(schema); /// { /// let mut index_writer = index.writer(3_000_000)?; -/// // a document can be associated to any number of facets +/// // a document can be associated with any number of facets /// index_writer.add_document(doc!( /// title => "The Name of the Wind", /// facet => Facet::from("/lang/en"), diff --git a/src/collector/histogram_collector.rs b/src/collector/histogram_collector.rs index 117f4f8df..915751f51 100644 --- a/src/collector/histogram_collector.rs +++ b/src/collector/histogram_collector.rs @@ -37,7 +37,7 @@ impl HistogramCollector { /// The scale/range of the histogram is not dynamic. It is required to /// define it by supplying following parameter: /// - `min_value`: the minimum value that can be recorded in the histogram. - /// - `bucket_width`: the length of the interval that is associated to each buckets. + /// - `bucket_width`: the length of the interval that is associated with each buckets. /// - `num_buckets`: The overall number of buckets. /// /// Together, this parameters define a partition of `[min_value, min_value + num_buckets * diff --git a/src/collector/mod.rs b/src/collector/mod.rs index 99c6cf1ca..81a9315ed 100644 --- a/src/collector/mod.rs +++ b/src/collector/mod.rs @@ -142,7 +142,7 @@ pub trait Collector: Sync + Send { /// e.g. `usize` for the `Count` collector. type Fruit: Fruit; - /// Type of the `SegmentCollector` associated to this collector. + /// Type of the `SegmentCollector` associated with this collector. type Child: SegmentCollector; /// `set_segment` is called before beginning to enumerate @@ -156,7 +156,7 @@ pub trait Collector: Sync + Send { /// Returns true iff the collector requires to compute scores for documents. fn requires_scoring(&self) -> bool; - /// Combines the fruit associated to the collection of each segments + /// Combines the fruit associated with the collection of each segments /// into one fruit. fn merge_fruits( &self, diff --git a/src/collector/top_score_collector.rs b/src/collector/top_score_collector.rs index 343969868..43b45cdbf 100644 --- a/src/collector/top_score_collector.rs +++ b/src/collector/top_score_collector.rs @@ -693,7 +693,7 @@ impl Collector for TopDocs { } } -/// Segment Collector associated to `TopDocs`. +/// Segment Collector associated with `TopDocs`. pub struct TopScoreSegmentCollector(TopSegmentCollector); impl SegmentCollector for TopScoreSegmentCollector { diff --git a/src/collector/tweak_score_top_collector.rs b/src/collector/tweak_score_top_collector.rs index ae86ca3fd..e7e8d1547 100644 --- a/src/collector/tweak_score_top_collector.rs +++ b/src/collector/tweak_score_top_collector.rs @@ -40,7 +40,7 @@ pub trait ScoreTweaker: Sync { /// Type of the associated [`ScoreSegmentTweaker`]. type Child: ScoreSegmentTweaker; - /// Builds a child tweaker for a specific segment. The child scorer is associated to + /// Builds a child tweaker for a specific segment. The child scorer is associated with /// a specific segment. fn segment_tweaker(&self, segment_reader: &SegmentReader) -> Result; } diff --git a/src/core/index_meta.rs b/src/core/index_meta.rs index 290932e59..355275438 100644 --- a/src/core/index_meta.rs +++ b/src/core/index_meta.rs @@ -130,7 +130,7 @@ impl SegmentMeta { /// Returns the relative path of a component of our segment. /// /// It just joins the segment id with the extension - /// associated to a segment component. + /// associated with a segment component. pub fn relative_path(&self, component: SegmentComponent) -> PathBuf { let mut path = self.id().uuid_string(); path.push_str(&*match component { @@ -326,13 +326,13 @@ pub struct IndexMeta { /// `IndexSettings` to configure index options. #[serde(default)] pub index_settings: IndexSettings, - /// List of `SegmentMeta` information associated to each finalized segment of the index. + /// List of `SegmentMeta` information associated with each finalized segment of the index. pub segments: Vec, /// Index `Schema` pub schema: Schema, - /// Opstamp associated to the last `commit` operation. + /// Opstamp associated with the last `commit` operation. pub opstamp: Opstamp, - /// Payload associated to the last commit. + /// Payload associated with the last commit. /// /// Upon commit, clients can optionally add a small `String` payload to their commit /// to help identify this commit. diff --git a/src/core/inverted_index_reader.rs b/src/core/inverted_index_reader.rs index db998a546..47002d71a 100644 --- a/src/core/inverted_index_reader.rs +++ b/src/core/inverted_index_reader.rs @@ -9,11 +9,11 @@ use crate::schema::{IndexRecordOption, Term}; use crate::termdict::TermDictionary; /// The inverted index reader is in charge of accessing -/// the inverted index associated to a specific field. +/// the inverted index associated with a specific field. /// /// # Note /// -/// It is safe to delete the segment associated to +/// It is safe to delete the segment associated with /// an `InvertedIndexReader`. As long as it is open, /// the `FileSlice` it is relying on should /// stay available. diff --git a/src/core/searcher.rs b/src/core/searcher.rs index 7fcbba4b2..9a28ebce0 100644 --- a/src/core/searcher.rs +++ b/src/core/searcher.rs @@ -69,7 +69,7 @@ pub struct Searcher { } impl Searcher { - /// Returns the `Index` associated to the `Searcher` + /// Returns the `Index` associated with the `Searcher` pub fn index(&self) -> &Index { &self.inner.index } @@ -108,7 +108,7 @@ impl Searcher { store_reader.get_async(doc_address.doc_id).await } - /// Access the schema associated to the index of this searcher. + /// Access the schema associated with the index of this searcher. pub fn schema(&self) -> &Schema { &self.inner.schema } @@ -161,11 +161,11 @@ impl Searcher { /// /// Search works as follows : /// - /// First the weight object associated to the query is created. + /// First the weight object associated with the query is created. /// /// Then, the query loops over the segments and for each segment : /// - setup the collector and informs it that the segment being processed has changed. - /// - creates a SegmentCollector for collecting documents associated to the segment + /// - creates a SegmentCollector for collecting documents associated with the segment /// - creates a `Scorer` object associated for this segment /// - iterate through the matched documents and push them to the segment collector. /// diff --git a/src/core/segment.rs b/src/core/segment.rs index 5f96279ff..21cf2d691 100644 --- a/src/core/segment.rs +++ b/src/core/segment.rs @@ -70,7 +70,7 @@ impl Segment { /// Returns the relative path of a component of our segment. /// /// It just joins the segment id with the extension - /// associated to a segment component. + /// associated with a segment component. pub fn relative_path(&self, component: SegmentComponent) -> PathBuf { self.meta.relative_path(component) } diff --git a/src/core/segment_component.rs b/src/core/segment_component.rs index 1855bb853..eb757a80d 100644 --- a/src/core/segment_component.rs +++ b/src/core/segment_component.rs @@ -6,7 +6,7 @@ use std::slice; /// except the delete component that takes an `segment_uuid`.`delete_opstamp`.`component_extension` #[derive(Copy, Clone, Eq, PartialEq)] pub enum SegmentComponent { - /// Postings (or inverted list). Sorted lists of document ids, associated to terms + /// Postings (or inverted list). Sorted lists of document ids, associated with terms Postings, /// Positions of terms in each document. Positions, diff --git a/src/core/segment_reader.rs b/src/core/segment_reader.rs index d432330f9..88b5e4dfa 100644 --- a/src/core/segment_reader.rs +++ b/src/core/segment_reader.rs @@ -89,7 +89,7 @@ impl SegmentReader { &self.fast_fields_readers } - /// Accessor to the `FacetReader` associated to a given `Field`. + /// Accessor to the `FacetReader` associated with a given `Field`. pub fn facet_reader(&self, field: Field) -> crate::Result { let field_entry = self.schema.get_field_entry(field); @@ -208,13 +208,13 @@ impl SegmentReader { }) } - /// Returns a field reader associated to the field given in argument. + /// Returns a field reader associated with the field given in argument. /// If the field was not present in the index during indexing time, /// the InvertedIndexReader is empty. /// /// The field reader is in charge of iterating through the - /// term dictionary associated to a specific field, - /// and opening the posting list associated to any term. + /// term dictionary associated with a specific field, + /// and opening the posting list associated with any term. /// /// If the field is not marked as index, a warn is logged and an empty `InvertedIndexReader` /// is returned. @@ -241,7 +241,7 @@ impl SegmentReader { if postings_file_opt.is_none() || record_option_opt.is_none() { // no documents in the segment contained this field. - // As a result, no data is associated to the inverted index. + // As a result, no data is associated with the inverted index. // // Returns an empty inverted index. let record_option = record_option_opt.unwrap_or(IndexRecordOption::Basic); diff --git a/src/directory/composite_file.rs b/src/directory/composite_file.rs index 9fc31e649..047c6c2df 100644 --- a/src/directory/composite_file.rs +++ b/src/directory/composite_file.rs @@ -154,14 +154,14 @@ impl CompositeFile { } } - /// Returns the `FileSlice` associated - /// to a given `Field` and stored in a `CompositeFile`. + /// Returns the `FileSlice` associated with + /// a given `Field` and stored in a `CompositeFile`. pub fn open_read(&self, field: Field) -> Option { self.open_read_with_idx(field, 0) } - /// Returns the `FileSlice` associated - /// to a given `Field` and stored in a `CompositeFile`. + /// Returns the `FileSlice` associated with + /// a given `Field` and stored in a `CompositeFile`. pub fn open_read_with_idx(&self, field: Field, idx: usize) -> Option { self.offsets_index .get(&FileAddr { field, idx }) diff --git a/src/directory/directory.rs b/src/directory/directory.rs index 246933bce..7ddd62117 100644 --- a/src/directory/directory.rs +++ b/src/directory/directory.rs @@ -39,7 +39,7 @@ impl RetryPolicy { /// The `DirectoryLock` is an object that represents a file lock. /// -/// It is associated to a lock file, that gets deleted on `Drop.` +/// It is associated with a lock file, that gets deleted on `Drop.` pub struct DirectoryLock(Box); struct DirectoryLockGuard { diff --git a/src/directory/mmap_directory.rs b/src/directory/mmap_directory.rs index 20449ae3e..afaaf0959 100644 --- a/src/directory/mmap_directory.rs +++ b/src/directory/mmap_directory.rs @@ -334,7 +334,7 @@ impl Directory for MmapDirectory { Ok(Arc::new(owned_bytes)) } - /// Any entry associated to the path in the mmap will be + /// Any entry associated with the path in the mmap will be /// removed before the file is deleted. fn delete(&self, path: &Path) -> result::Result<(), DeleteError> { let full_path = self.resolve_path(path); diff --git a/src/fastfield/bytes/reader.rs b/src/fastfield/bytes/reader.rs index 2f60e60f4..1340bfb66 100644 --- a/src/fastfield/bytes/reader.rs +++ b/src/fastfield/bytes/reader.rs @@ -39,13 +39,13 @@ impl BytesFastFieldReader { start..end } - /// Returns the bytes associated to the given `doc` + /// Returns the bytes associated with the given `doc` pub fn get_bytes(&self, doc: DocId) -> &[u8] { let range = self.range(doc); &self.values.as_slice()[range.start as usize..range.end as usize] } - /// Returns the length of the bytes associated to the given `doc` + /// Returns the length of the bytes associated with the given `doc` pub fn num_bytes(&self, doc: DocId) -> u64 { let range = self.range(doc); range.end - range.start diff --git a/src/fastfield/bytes/writer.rs b/src/fastfield/bytes/writer.rs index 61085b230..dcda5c3d7 100644 --- a/src/fastfield/bytes/writer.rs +++ b/src/fastfield/bytes/writer.rs @@ -24,7 +24,7 @@ use crate::DocId; /// /// Once acquired, writing is done by calling /// [`.add_document_val(&[u8])`](BytesFastFieldWriter::add_document_val) -/// once per document, even if there are no bytes associated to it. +/// once per document, even if there are no bytes associated with it. pub struct BytesFastFieldWriter { field: Field, vals: Vec, @@ -45,7 +45,7 @@ impl BytesFastFieldWriter { pub fn mem_usage(&self) -> usize { self.vals.capacity() + self.doc_index.capacity() * std::mem::size_of::() } - /// Access the field associated to the `BytesFastFieldWriter` + /// Access the field associated with the `BytesFastFieldWriter` pub fn field(&self) -> Field { self.field } @@ -67,7 +67,7 @@ impl BytesFastFieldWriter { } } - /// Register the bytes associated to a document. + /// Register the bytes associated with a document. /// /// The method returns the `DocId` of the document that was /// just written. diff --git a/src/fastfield/facet_reader.rs b/src/fastfield/facet_reader.rs index 2dbf66116..76fba33c5 100644 --- a/src/fastfield/facet_reader.rs +++ b/src/fastfield/facet_reader.rs @@ -7,7 +7,7 @@ use crate::termdict::{TermDictionary, TermOrdinal}; use crate::DocId; /// The facet reader makes it possible to access the list of -/// facets associated to a given document in a specific +/// facets associated with a given document in a specific /// segment. /// /// Rather than manipulating `Facet` object directly, the API @@ -58,7 +58,7 @@ impl FacetReader { &self.term_dict } - /// Given a term ordinal returns the term associated to it. + /// Given a term ordinal returns the term associated with it. pub fn facet_from_ord( &mut self, facet_ord: TermOrdinal, @@ -74,7 +74,7 @@ impl FacetReader { Ok(()) } - /// Return the list of facet ordinals associated to a document. + /// Return the list of facet ordinals associated with a document. pub fn facet_ords(&self, doc: DocId, output: &mut Vec) { self.term_ords.get_vals(doc, output); } diff --git a/src/fastfield/mod.rs b/src/fastfield/mod.rs index c73d2a0ba..40bb75056 100644 --- a/src/fastfield/mod.rs +++ b/src/fastfield/mod.rs @@ -49,7 +49,7 @@ mod writer; pub trait MultiValueLength { /// returns the positions for a docid fn get_range(&self, doc_id: DocId) -> std::ops::Range; - /// returns the num of values associated to a doc_id + /// returns the num of values associated with a doc_id fn get_len(&self, doc_id: DocId) -> u64; /// returns the sum of num values for all doc_ids fn get_total_len(&self) -> u64; diff --git a/src/fastfield/multivalued/reader.rs b/src/fastfield/multivalued/reader.rs index 88e4293cb..f8e41f2e1 100644 --- a/src/fastfield/multivalued/reader.rs +++ b/src/fastfield/multivalued/reader.rs @@ -30,8 +30,8 @@ impl MultiValuedFastFieldReader { } } - /// Returns `[start, end)`, such that the values associated - /// to the given document are `start..end`. + /// Returns `[start, end)`, such that the values associated with + /// the given document are `start..end`. #[inline] fn range(&self, doc: DocId) -> Range { let idx = doc as u64; @@ -40,7 +40,7 @@ impl MultiValuedFastFieldReader { start..end } - /// Returns the array of values associated to the given `doc`. + /// Returns the array of values associated with the given `doc`. #[inline] fn get_vals_for_range(&self, range: Range, vals: &mut Vec) { let len = (range.end - range.start) as usize; @@ -48,7 +48,7 @@ impl MultiValuedFastFieldReader { self.vals_reader.get_range(range.start, &mut vals[..]); } - /// Returns the array of values associated to the given `doc`. + /// Returns the array of values associated with the given `doc`. #[inline] pub fn get_vals(&self, doc: DocId, vals: &mut Vec) { let range = self.range(doc); diff --git a/src/fastfield/multivalued/writer.rs b/src/fastfield/multivalued/writer.rs index 212b49616..38aad7324 100644 --- a/src/fastfield/multivalued/writer.rs +++ b/src/fastfield/multivalued/writer.rs @@ -62,7 +62,7 @@ impl MultiValuedFastFieldWriter { + self.doc_index.capacity() * std::mem::size_of::() } - /// Access the field associated to the `MultiValuedFastFieldWriter` + /// Access the field associated with the `MultiValuedFastFieldWriter` pub fn field(&self) -> Field { self.field } diff --git a/src/fastfield/readers.rs b/src/fastfield/readers.rs index 5784bc451..68f9a811f 100644 --- a/src/fastfield/readers.rs +++ b/src/fastfield/readers.rs @@ -135,7 +135,7 @@ impl FastFieldReaders { Ok(MultiValuedFastFieldReader::open(idx_reader, vals_reader)) } - /// Returns the `u64` fast field reader reader associated to `field`. + /// Returns the `u64` fast field reader reader associated with `field`. /// /// If `field` is not a u64 fast field, this method returns an Error. pub fn u64(&self, field: Field) -> crate::Result>> { @@ -143,16 +143,16 @@ impl FastFieldReaders { self.typed_fast_field_reader(field) } - /// Returns the `u64` fast field reader reader associated to `field`, regardless of whether the - /// given field is effectively of type `u64` or not. + /// Returns the `u64` fast field reader reader associated with `field`, regardless of whether + /// the given field is effectively of type `u64` or not. /// - /// If not, the fastfield reader will returns the u64-value associated to the original + /// If not, the fastfield reader will returns the u64-value associated with the original /// FastValue. pub fn u64_lenient(&self, field: Field) -> crate::Result>> { self.typed_fast_field_reader(field) } - /// Returns the `i64` fast field reader reader associated to `field`. + /// Returns the `i64` fast field reader reader associated with `field`. /// /// If `field` is not a i64 fast field, this method returns an Error. pub fn i64(&self, field: Field) -> crate::Result>> { @@ -160,7 +160,7 @@ impl FastFieldReaders { self.typed_fast_field_reader(field) } - /// Returns the `date` fast field reader reader associated to `field`. + /// Returns the `date` fast field reader reader associated with `field`. /// /// If `field` is not a date fast field, this method returns an Error. pub fn date(&self, field: Field) -> crate::Result>> { @@ -168,7 +168,7 @@ impl FastFieldReaders { self.typed_fast_field_reader(field) } - /// Returns the `f64` fast field reader reader associated to `field`. + /// Returns the `f64` fast field reader reader associated with `field`. /// /// If `field` is not a f64 fast field, this method returns an Error. pub fn f64(&self, field: Field) -> crate::Result>> { @@ -176,7 +176,7 @@ impl FastFieldReaders { self.typed_fast_field_reader(field) } - /// Returns the `bool` fast field reader reader associated to `field`. + /// Returns the `bool` fast field reader reader associated with `field`. /// /// If `field` is not a bool fast field, this method returns an Error. pub fn bool(&self, field: Field) -> crate::Result>> { @@ -184,7 +184,7 @@ impl FastFieldReaders { self.typed_fast_field_reader(field) } - /// Returns a `u64s` multi-valued fast field reader reader associated to `field`. + /// Returns a `u64s` multi-valued fast field reader reader associated with `field`. /// /// If `field` is not a u64 multi-valued fast field, this method returns an Error. pub fn u64s(&self, field: Field) -> crate::Result> { @@ -192,15 +192,15 @@ impl FastFieldReaders { self.typed_fast_field_multi_reader(field) } - /// Returns a `u64s` multi-valued fast field reader reader associated to `field`, regardless of - /// whether the given field is effectively of type `u64` or not. + /// Returns a `u64s` multi-valued fast field reader reader associated with `field`, regardless + /// of whether the given field is effectively of type `u64` or not. /// /// If `field` is not a u64 multi-valued fast field, this method returns an Error. pub fn u64s_lenient(&self, field: Field) -> crate::Result> { self.typed_fast_field_multi_reader(field) } - /// Returns a `i64s` multi-valued fast field reader reader associated to `field`. + /// Returns a `i64s` multi-valued fast field reader reader associated with `field`. /// /// If `field` is not a i64 multi-valued fast field, this method returns an Error. pub fn i64s(&self, field: Field) -> crate::Result> { @@ -208,7 +208,7 @@ impl FastFieldReaders { self.typed_fast_field_multi_reader(field) } - /// Returns a `f64s` multi-valued fast field reader reader associated to `field`. + /// Returns a `f64s` multi-valued fast field reader reader associated with `field`. /// /// If `field` is not a f64 multi-valued fast field, this method returns an Error. pub fn f64s(&self, field: Field) -> crate::Result> { @@ -216,7 +216,7 @@ impl FastFieldReaders { self.typed_fast_field_multi_reader(field) } - /// Returns a `bools` multi-valued fast field reader reader associated to `field`. + /// Returns a `bools` multi-valued fast field reader reader associated with `field`. /// /// If `field` is not a bool multi-valued fast field, this method returns an Error. pub fn bools(&self, field: Field) -> crate::Result> { @@ -224,7 +224,7 @@ impl FastFieldReaders { self.typed_fast_field_multi_reader(field) } - /// Returns a `time::OffsetDateTime` multi-valued fast field reader reader associated to + /// Returns a `time::OffsetDateTime` multi-valued fast field reader reader associated with /// `field`. /// /// If `field` is not a `time::OffsetDateTime` multi-valued fast field, this method returns an @@ -234,7 +234,7 @@ impl FastFieldReaders { self.typed_fast_field_multi_reader(field) } - /// Returns the `bytes` fast field reader associated to `field`. + /// Returns the `bytes` fast field reader associated with `field`. /// /// If `field` is not a bytes fast field, returns an Error. pub fn bytes(&self, field: Field) -> crate::Result { diff --git a/src/fastfield/writer.rs b/src/fastfield/writer.rs index a7d70635b..8e55c1b8b 100644 --- a/src/fastfield/writer.rs +++ b/src/fastfield/writer.rs @@ -131,7 +131,7 @@ impl FastFieldsWriter { .sum::() } - /// Get the `FastFieldWriter` associated to a field. + /// Get the `FastFieldWriter` associated with a field. pub fn get_term_id_writer(&self, field: Field) -> Option<&MultiValuedFastFieldWriter> { // TODO optimize self.term_id_writers @@ -139,7 +139,7 @@ impl FastFieldsWriter { .find(|field_writer| field_writer.field() == field) } - /// Get the `FastFieldWriter` associated to a field. + /// Get the `FastFieldWriter` associated with a field. pub fn get_field_writer(&self, field: Field) -> Option<&IntFastFieldWriter> { // TODO optimize self.single_value_writers @@ -147,7 +147,7 @@ impl FastFieldsWriter { .find(|field_writer| field_writer.field() == field) } - /// Get the `FastFieldWriter` associated to a field. + /// Get the `FastFieldWriter` associated with a field. pub fn get_field_writer_mut(&mut self, field: Field) -> Option<&mut IntFastFieldWriter> { // TODO optimize self.single_value_writers @@ -155,7 +155,7 @@ impl FastFieldsWriter { .find(|field_writer| field_writer.field() == field) } - /// Get the `FastFieldWriter` associated to a field. + /// Get the `FastFieldWriter` associated with a field. pub fn get_term_id_writer_mut( &mut self, field: Field, @@ -294,7 +294,7 @@ impl IntFastFieldWriter { /// Records a new value. /// /// The n-th value being recorded is implicitly - /// associated to the document with the `DocId` n. + /// associated with the document with the `DocId` n. /// (Well, `n-1` actually because of 0-indexing) pub fn add_val(&mut self, val: u64) { self.vals.add(val); @@ -313,7 +313,7 @@ impl IntFastFieldWriter { /// (or use the default value) and records it. /// /// - /// Extract the value associated to the fast field for + /// Extract the value associated with the fast field for /// this document. /// /// i64 and f64 are remapped to u64 using the logic @@ -383,7 +383,7 @@ struct WriterFastFieldAccessProvider<'map, 'bitp> { } impl<'map, 'bitp> Column for WriterFastFieldAccessProvider<'map, 'bitp> { - /// Return the value associated to the given doc. + /// Return the value associated with the given doc. /// /// Whenever possible use the Iterator passed to the fastfield creation instead, for performance /// reasons. diff --git a/src/fieldnorm/mod.rs b/src/fieldnorm/mod.rs index 1238d7ec5..1876c04a3 100644 --- a/src/fieldnorm/mod.rs +++ b/src/fieldnorm/mod.rs @@ -1,4 +1,4 @@ -//! The fieldnorm represents the length associated to +//! The fieldnorm represents the length associated with //! a given Field of a given document. //! //! This metric is important to compute the score of a diff --git a/src/fieldnorm/reader.rs b/src/fieldnorm/reader.rs index fc4c59171..77ba0086c 100644 --- a/src/fieldnorm/reader.rs +++ b/src/fieldnorm/reader.rs @@ -47,9 +47,9 @@ impl FieldNormReaders { } } -/// Reads the fieldnorm associated to a document. +/// Reads the fieldnorm associated with a document. /// -/// The [fieldnorm](FieldNormReader::fieldnorm) represents the length associated to +/// The [fieldnorm](FieldNormReader::fieldnorm) represents the length associated with /// a given Field of a given document. #[derive(Clone)] pub struct FieldNormReader(ReaderImplEnum); @@ -104,7 +104,7 @@ impl FieldNormReader { } } - /// Returns the `fieldnorm` associated to a doc id. + /// Returns the `fieldnorm` associated with a doc id. /// The fieldnorm is a value approximating the number /// of tokens in a given field of the `doc_id`. /// @@ -123,7 +123,7 @@ impl FieldNormReader { } } - /// Returns the `fieldnorm_id` associated to a document. + /// Returns the `fieldnorm_id` associated with a document. #[inline] pub fn fieldnorm_id(&self, doc_id: DocId) -> u8 { match &self.0 { diff --git a/src/indexer/index_writer.rs b/src/indexer/index_writer.rs index 065e65ec1..a49a4c064 100644 --- a/src/indexer/index_writer.rs +++ b/src/indexer/index_writer.rs @@ -370,9 +370,9 @@ impl IndexWriter { /// This method is useful only for users trying to do complex /// operations, like converting an index format to another. /// - /// It is safe to start writing file associated to the new `Segment`. + /// It is safe to start writing file associated with the new `Segment`. /// These will not be garbage collected as long as an instance object of - /// `SegmentMeta` object associated to the new `Segment` is "alive". + /// `SegmentMeta` object associated with the new `Segment` is "alive". pub fn new_segment(&self) -> Segment { self.index.new_segment() } diff --git a/src/indexer/prepared_commit.rs b/src/indexer/prepared_commit.rs index 96b1baef0..da3946eba 100644 --- a/src/indexer/prepared_commit.rs +++ b/src/indexer/prepared_commit.rs @@ -17,7 +17,7 @@ impl<'a> PreparedCommit<'a> { } } - /// Returns the opstamp associated to the prepared commit. + /// Returns the opstamp associated with the prepared commit. pub fn opstamp(&self) -> Opstamp { self.opstamp } diff --git a/src/postings/recorder.rs b/src/postings/recorder.rs index d3bda8e72..8b07851c6 100644 --- a/src/postings/recorder.rs +++ b/src/postings/recorder.rs @@ -50,7 +50,7 @@ impl<'a> Iterator for VInt32Reader<'a> { /// Recorder is in charge of recording relevant information about /// the presence of a term in a document. /// -/// Depending on the `TextIndexingOptions` associated to the +/// Depending on the `TextIndexingOptions` associated with the /// field, the recorder may records /// * the document frequency /// * the document id diff --git a/src/postings/segment_postings.rs b/src/postings/segment_postings.rs index 3fcc84e13..2b9ee8c5c 100644 --- a/src/postings/segment_postings.rs +++ b/src/postings/segment_postings.rs @@ -7,7 +7,7 @@ use crate::postings::compression::COMPRESSION_BLOCK_SIZE; use crate::postings::{branchless_binary_search, BlockSegmentPostings, Postings}; use crate::{DocId, TERMINATED}; -/// `SegmentPostings` represents the inverted list or postings associated to +/// `SegmentPostings` represents the inverted list or postings associated with /// a term in a `Segment`. /// /// As we iterate through the `SegmentPostings`, the frequencies are optionally decoded. @@ -216,7 +216,7 @@ impl HasLen for SegmentPostings { } impl Postings for SegmentPostings { - /// Returns the frequency associated to the current document. + /// Returns the frequency associated with the current document. /// If the schema is set up so that no frequency have been encoded, /// this method should always return 1. /// diff --git a/src/postings/term_info.rs b/src/postings/term_info.rs index 03fb81794..d276c97d7 100644 --- a/src/postings/term_info.rs +++ b/src/postings/term_info.rs @@ -4,7 +4,7 @@ use std::ops::Range; use common::{BinarySerializable, FixedSize}; -/// `TermInfo` wraps the metadata associated to a Term. +/// `TermInfo` wraps the metadata associated with a Term. /// It is segment-local. #[derive(Debug, Default, Eq, PartialEq, Clone)] pub struct TermInfo { diff --git a/src/query/all_query.rs b/src/query/all_query.rs index f47c33c7d..f5793a15c 100644 --- a/src/query/all_query.rs +++ b/src/query/all_query.rs @@ -17,7 +17,7 @@ impl Query for AllQuery { } } -/// Weight associated to the `AllQuery` query. +/// Weight associated with the `AllQuery` query. pub struct AllWeight; impl Weight for AllWeight { @@ -37,7 +37,7 @@ impl Weight for AllWeight { } } -/// Scorer associated to the `AllQuery` query. +/// Scorer associated with the `AllQuery` query. pub struct AllScorer { doc: DocId, max_doc: DocId, diff --git a/src/query/bitset/mod.rs b/src/query/bitset/mod.rs index ba4d7a3b1..09b9d8360 100644 --- a/src/query/bitset/mod.rs +++ b/src/query/bitset/mod.rs @@ -14,7 +14,7 @@ use crate::DocId; /// when the bitset is sparse pub struct BitSetDocSet { docs: BitSet, - cursor_bucket: u32, //< index associated to the current tiny bitset + cursor_bucket: u32, //< index associated with the current tiny bitset cursor_tinybitset: TinySet, doc: u32, } diff --git a/src/query/explanation.rs b/src/query/explanation.rs index a4cce46dd..8b08b3242 100644 --- a/src/query/explanation.rs +++ b/src/query/explanation.rs @@ -39,7 +39,7 @@ impl Explanation { } } - /// Returns the value associated to the current node. + /// Returns the value associated with the current node. pub fn value(&self) -> Score { self.value } diff --git a/src/query/intersection.rs b/src/query/intersection.rs index e86f0eb1f..61c8ca8f3 100644 --- a/src/query/intersection.rs +++ b/src/query/intersection.rs @@ -5,7 +5,7 @@ use crate::{DocId, Score}; /// Returns the intersection scorer. /// -/// The score associated to the documents is the sum of the +/// The score associated with the documents is the sum of the /// score of the `Scorer`s given in argument. /// /// For better performance, the function uses a diff --git a/src/query/phrase_query/phrase_query.rs b/src/query/phrase_query/phrase_query.rs index 969920aef..d5fcbd62b 100644 --- a/src/query/phrase_query/phrase_query.rs +++ b/src/query/phrase_query/phrase_query.rs @@ -119,7 +119,7 @@ impl PhraseQuery { } impl Query for PhraseQuery { - /// Create the weight associated to a query. + /// Create the weight associated with a query. /// /// See [`Weight`]. fn weight(&self, searcher: &Searcher, scoring_enabled: bool) -> crate::Result> { diff --git a/src/query/query.rs b/src/query/query.rs index 530b9cb43..245569077 100644 --- a/src/query/query.rs +++ b/src/query/query.rs @@ -42,7 +42,7 @@ use crate::{DocAddress, Term}; /// [`Scorer`]: crate::query::Scorer /// [`SegmentReader`]: crate::SegmentReader pub trait Query: QueryClone + Send + Sync + downcast_rs::Downcast + fmt::Debug { - /// Create the weight associated to a query. + /// Create the weight associated with a query. /// /// If scoring is not required, setting `scoring_enabled` to `false` /// can increase performances. @@ -67,7 +67,7 @@ pub trait Query: QueryClone + Send + Sync + downcast_rs::Downcast + fmt::Debug { Ok(result) } - /// Extract all of the terms associated to the query and pass them to the + /// Extract all of the terms associated with the query and pass them to the /// given closure. /// /// Each term is associated with a boolean indicating whether diff --git a/src/query/query_parser/query_parser.rs b/src/query/query_parser/query_parser.rs index fcaf3432e..f9e032f7a 100644 --- a/src/query/query_parser/query_parser.rs +++ b/src/query/query_parser/query_parser.rs @@ -610,7 +610,7 @@ impl QueryParser { if let Some((field, path)) = self.split_full_path(full_path) { return Ok(vec![(field, path, literal.phrase.as_str())]); } - // We need to add terms associated to json default fields. + // We need to add terms associated with json default fields. let triplets: Vec<(Field, &str, &str)> = self .default_indexed_json_fields() .map(|json_field| (json_field, full_path.as_str(), literal.phrase.as_str())) diff --git a/src/schema/bytes_options.rs b/src/schema/bytes_options.rs index 94074d31a..37382d337 100644 --- a/src/schema/bytes_options.rs +++ b/src/schema/bytes_options.rs @@ -83,7 +83,7 @@ impl BytesOptions { /// /// Fast fields are designed for random access. /// Access time are similar to a random lookup in an array. - /// If more than one value is associated to a fast field, only the last one is + /// If more than one value is associated with a fast field, only the last one is /// kept. #[must_use] pub fn set_fast(mut self) -> BytesOptions { diff --git a/src/schema/date_time_options.rs b/src/schema/date_time_options.rs index 1defc6253..3b8d5445b 100644 --- a/src/schema/date_time_options.rs +++ b/src/schema/date_time_options.rs @@ -104,7 +104,7 @@ impl DateOptions { /// /// Fast fields are designed for random access. /// Access time are similar to a random lookup in an array. - /// If more than one value is associated to a fast field, only the last one is + /// If more than one value is associated with a fast field, only the last one is /// kept. #[must_use] pub fn set_fast(mut self, cardinality: Cardinality) -> DateOptions { diff --git a/src/schema/facet.rs b/src/schema/facet.rs index 6c68d758b..8c5c99916 100644 --- a/src/schema/facet.rs +++ b/src/schema/facet.rs @@ -35,7 +35,7 @@ pub enum FacetParseError { /// For instance, an e-commerce website could /// have a `Facet` for `/electronics/tv_and_video/led_tv`. /// -/// A document can be associated to any number of facets. +/// A document can be associated with any number of facets. /// The hierarchy implicitly imply that a document /// belonging to a facet also belongs to the ancestor of /// its facet. In the example above, `/electronics/tv_and_video/` diff --git a/src/schema/ip_options.rs b/src/schema/ip_options.rs index 70a08e15f..195d46916 100644 --- a/src/schema/ip_options.rs +++ b/src/schema/ip_options.rs @@ -43,7 +43,7 @@ impl IpOptions { /// /// Fast fields are designed for random access. /// Access time are similar to a random lookup in an array. - /// If more than one value is associated to a fast field, only the last one is + /// If more than one value is associated with a fast field, only the last one is /// kept. #[must_use] pub fn set_fast(mut self, cardinality: Cardinality) -> Self { diff --git a/src/schema/numeric_options.rs b/src/schema/numeric_options.rs index 8b2b75033..3f82fe5db 100644 --- a/src/schema/numeric_options.rs +++ b/src/schema/numeric_options.rs @@ -7,10 +7,10 @@ use crate::schema::flags::{FastFlag, IndexedFlag, SchemaFlagList, StoredFlag}; /// Express whether a field is single-value or multi-valued. #[derive(Clone, Copy, PartialEq, Eq, Debug, Serialize, Deserialize)] pub enum Cardinality { - /// The document must have exactly one value associated to the document. + /// The document must have exactly one value associated with the document. #[serde(rename = "single")] SingleValue, - /// The document can have any number of values associated to the document. + /// The document can have any number of values associated with the document. /// This is more memory and CPU expensive than the `SingleValue` solution. #[serde(rename = "multi")] MultiValues, @@ -124,7 +124,7 @@ impl NumericOptions { /// /// Fast fields are designed for random access. /// Access time are similar to a random lookup in an array. - /// If more than one value is associated to a fast field, only the last one is + /// If more than one value is associated with a fast field, only the last one is /// kept. #[must_use] pub fn set_fast(mut self, cardinality: Cardinality) -> NumericOptions { diff --git a/src/schema/schema.rs b/src/schema/schema.rs index e91a31a62..c4db97a89 100644 --- a/src/schema/schema.rs +++ b/src/schema/schema.rs @@ -258,7 +258,7 @@ impl Eq for InnerSchema {} pub struct Schema(Arc); impl Schema { - /// Return the `FieldEntry` associated to a `Field`. + /// Return the `FieldEntry` associated with a `Field`. pub fn get_field_entry(&self, field: Field) -> &FieldEntry { &self.0.fields[field.field_id() as usize] } diff --git a/src/schema/text_options.rs b/src/schema/text_options.rs index 5fc4ebb94..44d74fd6c 100644 --- a/src/schema/text_options.rs +++ b/src/schema/text_options.rs @@ -161,7 +161,7 @@ impl TextFieldIndexing { self } - /// Returns the indexing options associated to this field. + /// Returns the indexing options associated with this field. /// /// See [`IndexRecordOption`] for more detail. pub fn index_option(&self) -> IndexRecordOption { diff --git a/src/snippet/mod.rs b/src/snippet/mod.rs index a542d4595..fce0f3a97 100644 --- a/src/snippet/mod.rs +++ b/src/snippet/mod.rs @@ -342,7 +342,7 @@ impl SnippetGenerator { /// Generates a snippet for the given `Document`. /// - /// This method extract the text associated to the `SnippetGenerator`'s field + /// This method extract the text associated with the `SnippetGenerator`'s field /// and computes a snippet. pub fn snippet_from_doc(&self, doc: &Document) -> Snippet { let text: String = doc diff --git a/src/termdict/fst_termdict/termdict.rs b/src/termdict/fst_termdict/termdict.rs index 02709f991..a2cde8165 100644 --- a/src/termdict/fst_termdict/termdict.rs +++ b/src/termdict/fst_termdict/termdict.rs @@ -138,12 +138,12 @@ impl TermDictionary { self.term_info_store.num_terms() } - /// Returns the ordinal associated to a given term. + /// Returns the ordinal associated with a given term. pub fn term_ord>(&self, key: K) -> io::Result> { Ok(self.fst_index.get(key)) } - /// Stores the term associated to a given term ordinal in + /// Stores the term associated with a given term ordinal in /// a `bytes` buffer. /// /// Term ordinals are defined as the position of the term in diff --git a/src/termdict/sstable_termdict/termdict.rs b/src/termdict/sstable_termdict/termdict.rs index 0b93fc738..aa5bab4ad 100644 --- a/src/termdict/sstable_termdict/termdict.rs +++ b/src/termdict/sstable_termdict/termdict.rs @@ -153,7 +153,7 @@ impl TermDictionary { self.num_terms as usize } - /// Returns the ordinal associated to a given term. + /// Returns the ordinal associated with a given term. pub fn term_ord>(&self, key: K) -> io::Result> { let mut term_ord = 0u64; let key_bytes = key.as_ref(); @@ -167,7 +167,7 @@ impl TermDictionary { Ok(None) } - /// Returns the term associated to a given term ordinal. + /// Returns the term associated with a given term ordinal. /// /// Term ordinals are defined as the position of the term in /// the sorted list of terms.