From edcfa915ff7a701f7a5bdc6c4df3d8312b52bff3 Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Fri, 26 Apr 2019 09:22:01 +0900 Subject: [PATCH] Added logging when token is dropped. --- src/postings/postings_writer.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/postings/postings_writer.rs b/src/postings/postings_writer.rs index d26325862..d5d769b33 100644 --- a/src/postings/postings_writer.rs +++ b/src/postings/postings_writer.rs @@ -214,6 +214,13 @@ pub trait PostingsWriter { if token.text.len() <= MAX_TOKEN_LEN { term.set_text(token.text.as_str()); self.subscribe(term_index, doc_id, token.position as u32, &term, heap); + } else { + info!( + "A token exceeding MAX_TOKEN_LEN ({}>{}) was dropped. Search for \ + MAX_TOKEN_LEN in the documentation for more information.", + token.text.len(), + MAX_TOKEN_LEN + ); } }; token_stream.process(&mut sink)