From bf7603d43951f5c295b61a778c468135532ddb36 Mon Sep 17 00:00:00 2001 From: fdb-hiroshima <35889323+fdb-hiroshima@users.noreply.github.com> Date: Tue, 27 Aug 2019 18:40:59 +0200 Subject: [PATCH] don't index drafts (#656) --- plume-models/src/search/searcher.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plume-models/src/search/searcher.rs b/plume-models/src/search/searcher.rs index 87ee6d7c..2a567741 100644 --- a/plume-models/src/search/searcher.rs +++ b/plume-models/src/search/searcher.rs @@ -148,6 +148,10 @@ impl Searcher { } pub fn add_document(&self, conn: &Connection, post: &Post) -> Result<()> { + if !post.published { + return Ok(()); + } + let schema = self.index.schema(); let post_id = schema.get_field("post_id").unwrap();