feat: Introduce the Serializer

Which will serialize documents fields as message pack in the kv-store
This commit is contained in:
Clément Renault 2019-04-19 15:50:53 +02:00
parent 2a69170f14
commit ea0ee070ef
No known key found for this signature in database
GPG key ID: 0151CDAB43460DAE
5 changed files with 508 additions and 5 deletions

View file

@ -23,6 +23,13 @@ impl Indexer {
}
}
pub fn with_word_limit(limit: usize) -> Indexer {
Indexer {
word_limit: limit,
indexed: BTreeMap::new(),
}
}
pub fn index_text(&mut self, id: DocumentId, attr: SchemaAttr, text: &str) {
for token in Tokenizer::new(text) {
if token.word_index >= self.word_limit { break }