mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-10 11:02:55 +00:00
issues/65 Updated changelog added some doc.
This commit is contained in:
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
||||
Tantivy 0.4.0
|
||||
==========================
|
||||
|
||||
- Removed u32 fields. They are replaced by u64 and i64 fields (#65)
|
||||
-
|
||||
|
||||
|
||||
Tantivy 0.3.1
|
||||
==========================
|
||||
|
||||
- Expose a method to trigger files garbage collection
|
||||
- Raise the limit of number of fields (previously 256 fields)
|
||||
|
||||
|
||||
Tantivy 0.3
|
||||
==========================
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tantivy"
|
||||
version = "0.3.1"
|
||||
version = "0.4.0-alpha"
|
||||
authors = ["Paul Masurel <paul.masurel@gmail.com>"]
|
||||
build = "build.rs"
|
||||
license = "MIT"
|
||||
|
||||
@@ -68,8 +68,8 @@ impl Searcher {
|
||||
}
|
||||
|
||||
/// Returns the segment_reader associated with the given segment_ordinal
|
||||
pub fn segment_reader(&self, segment_ord: usize) -> &SegmentReader {
|
||||
&self.segment_readers[segment_ord]
|
||||
pub fn segment_reader(&self, segment_ord: u32) -> &SegmentReader {
|
||||
&self.segment_readers[segment_ord as usize]
|
||||
}
|
||||
|
||||
/// Runs a query on the segment readers wrapped by the searcher
|
||||
@@ -78,6 +78,7 @@ impl Searcher {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl From<Vec<SegmentReader>> for Searcher {
|
||||
fn from(segment_readers: Vec<SegmentReader>) -> Searcher {
|
||||
Searcher {
|
||||
|
||||
@@ -10,6 +10,10 @@ pub struct FastFieldNotAvailableError {
|
||||
}
|
||||
|
||||
impl FastFieldNotAvailableError {
|
||||
|
||||
/// Creates a `FastFieldNotAvailable` error.
|
||||
/// `field_entry` is the configuration of the field
|
||||
/// for which fast fields are not available.
|
||||
pub fn new(field_entry: &FieldEntry) -> FastFieldNotAvailableError {
|
||||
FastFieldNotAvailableError {
|
||||
field_name: field_entry.name().clone(),
|
||||
|
||||
@@ -46,7 +46,7 @@ impl FastFieldsWriter {
|
||||
field_writers: field_writers,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub fn new(fields: Vec<Field>) -> FastFieldsWriter {
|
||||
FastFieldsWriter {
|
||||
field_writers: fields
|
||||
@@ -56,6 +56,7 @@ impl FastFieldsWriter {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `FastFieldWriter` associated to a field.
|
||||
pub fn get_field_writer(&mut self, field: Field) -> Option<&mut IntFastFieldWriter> {
|
||||
// TODO optimize
|
||||
self.field_writers
|
||||
@@ -63,15 +64,19 @@ impl FastFieldsWriter {
|
||||
.find(|field_writer| field_writer.field == field)
|
||||
}
|
||||
|
||||
|
||||
/// Indexes all of the fastfields of a new document.
|
||||
pub fn add_document(&mut self, doc: &Document) {
|
||||
for field_writer in &mut self.field_writers {
|
||||
field_writer.add_document(doc);
|
||||
}
|
||||
}
|
||||
|
||||
/// Serializes all of the `FastFieldWriter`s by pushing them in
|
||||
/// order to the fast field serializer.
|
||||
pub fn serialize(&self, serializer: &mut FastFieldSerializer) -> io::Result<()> {
|
||||
for field_writer in &self.field_writers {
|
||||
try!(field_writer.serialize(serializer));
|
||||
field_writer.serialize(serializer)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -84,7 +89,6 @@ impl FastFieldsWriter {
|
||||
for field_writer in &mut self.field_writers {
|
||||
field_writer.fill_val_up_to(doc);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +144,12 @@ impl IntFastFieldWriter {
|
||||
self.add_val(val_if_missing);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Records a new value.
|
||||
///
|
||||
/// The n-th value being recorded is implicitely
|
||||
/// associated to the document with the `DocId` n.
|
||||
/// (Well, `n-1` actually because of 0-indexing)
|
||||
pub fn add_val(&mut self, val: u64) {
|
||||
self.vals.push(val);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user