don't index drafts (#656)

This commit is contained in:
fdb-hiroshima 2019-08-27 18:40:59 +02:00 committed by GitHub
parent 8ab690001d
commit bf7603d439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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