Update dependencies (#428)
* Bump serde from 1.0.82 to 1.0.84 * Bump ructe from 0.5.4 to 0.5.6 * Bump colored from 1.6.1 to 1.7.0 * Bump itertools from 0.7.11 to 0.8.0 * Bump ammonia from 1.2.0 to 2.0.0 * Bump hyper from 0.12.19 to 0.12.20 * Bump serde_derive from 1.0.80 to 1.0.84 * Bump stdweb from 0.4.12 to 0.4.13 * Bump rsass from 0.9.4 to 0.9.6 * Bump failure from 0.1.3 to 0.1.5 * Bump reqwest from 0.9.5 to 0.9.8 * Bump serde_derive from 0.7.1 to 0.8.0
This commit is contained in:
@@ -5,13 +5,13 @@ authors = ["Plume contributors"]
|
||||
|
||||
[dependencies]
|
||||
activitypub = "0.1.1"
|
||||
ammonia = "1.2.0"
|
||||
ammonia = "2.0.0"
|
||||
askama_escape = "0.1"
|
||||
bcrypt = "0.2"
|
||||
canapi = "0.2"
|
||||
guid-create = "0.1"
|
||||
heck = "0.3.0"
|
||||
itertools = "0.7.8"
|
||||
itertools = "0.8.0"
|
||||
lazy_static = "*"
|
||||
openssl = "0.10.15"
|
||||
rocket = "0.4.0"
|
||||
@@ -20,7 +20,7 @@ scheduled-thread-pool = "0.2.0"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
tantivy = "0.7.1"
|
||||
tantivy = "0.8.0"
|
||||
url = "1.7"
|
||||
webfinger = "0.3.1"
|
||||
whatlang = "0.6.0"
|
||||
|
||||
@@ -6,7 +6,7 @@ use Connection;
|
||||
use chrono::Datelike;
|
||||
use itertools::Itertools;
|
||||
use tantivy::{
|
||||
collector::TopCollector, directory::MmapDirectory,
|
||||
collector::TopDocs, directory::MmapDirectory,
|
||||
schema::*, tokenizer::*, Index, IndexWriter, Term
|
||||
};
|
||||
use whatlang::{detect as detect_lang, Lang};
|
||||
@@ -177,14 +177,14 @@ impl Searcher {
|
||||
let schema = self.index.schema();
|
||||
let post_id = schema.get_field("post_id").unwrap();
|
||||
|
||||
let mut collector = TopCollector::with_limit(cmp::max(1,max) as usize);
|
||||
let collector = TopDocs::with_limit(cmp::max(1,max) as usize);
|
||||
|
||||
let searcher = self.index.searcher();
|
||||
searcher.search(&query.into_query(), &mut collector).unwrap();
|
||||
let res = searcher.search(&query.into_query(), &collector).unwrap();
|
||||
|
||||
collector.docs().get(min as usize..).unwrap_or(&[])
|
||||
res.get(min as usize..).unwrap_or(&[])
|
||||
.into_iter()
|
||||
.filter_map(|doc_add| {
|
||||
.filter_map(|(_,doc_add)| {
|
||||
let doc = searcher.doc(*doc_add).ok()?;
|
||||
let id = doc.get_first(post_id)?;
|
||||
Post::get(conn, id.i64_value() as i32).ok()
|
||||
|
||||
Reference in New Issue
Block a user