You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I want to use TopDocsByField and i have created a module by copying the "native/src/js_top_docs/mod.rs".
I'm getting the error on the Ok() line; expected struct 'tantiny::collector::TopDocs', found struct 'tantiny::collector::TopDocsByField'.
How to fix this an continue? (BTW: I'm just starting to learn Rust)
extern crate tantivy;
use neon::prelude::*;
use tantivy::collector::TopDocs;
declare_types! {
pub class JsTopDocsByField for TopDocs {
init(mut cx) {
let n_docs = cx.argument::<JsNumber>(0)?.value() as usize;
let order_by_field = cx.argument::<JsString>(1)?.value();
Ok(TopDocs::with_limit(n_docs).order_by_field(sort_by_field))
}
}
}```
The text was updated successfully, but these errors were encountered:
Hi,
I want to use TopDocsByField and i have created a module by copying the "native/src/js_top_docs/mod.rs".
I'm getting the error on the Ok() line;
expected struct 'tantiny::collector::TopDocs', found struct 'tantiny::collector::TopDocsByField'
.How to fix this an continue? (BTW: I'm just starting to learn Rust)
The text was updated successfully, but these errors were encountered: