issues/65 Updated changelog added some doc.

This commit is contained in:
Paul Masurel
2017-05-04 17:13:14 +08:00
parent 5cb5c9a8f2
commit 83263eabbb
5 changed files with 35 additions and 7 deletions

View File

@@ -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
==========================

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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(),

View File

@@ -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);
}