Crates.io | tique |
lib.rs | tique |
version | 0.7.0 |
source | src |
created_at | 2020-01-29 13:12:36.744391 |
updated_at | 2021-09-11 07:33:23.990321 |
description | Utilities to drive a tantivy search index |
homepage | https://github.com/caio/cantine/tree/master/tique |
repository | https://github.com/caio/cantine/ |
max_upload_size | |
id | 203021 |
size | 127,198 |
Utilities to drive a tantivy search index
Here's a brief overview of the functionality we provide. Check the module docs for more details and examples.
Collectors with built-in support for changing the ordering and cursor-based pagination (or rather: support for conditionally skipping documents that match the query).
use tique::conditional_collector::{Ascending, TopCollector};
let min_rank_collector =
TopCollector::<f64, Ascending, _>::new(10, true).top_fast_field(f64_field);
Uses your index to find keywords and similar items to your documents or any arbitrary input.
let topterms = TopTerms::new(&index, vec![body, title])?;
let keywords = topterms.extract(5, "the quick fox jumps over the lazy dog");
let similarity_query = keywords.into_boosted_query(1.0);
A query parser with a simple grammar geared towards usage by end-users, with no knowledge about IR, your index nor boolean logic.
Supports multiple fields, boosts, required (+) and restricted (-)
items and can generate queries using DisMaxQuery
for better
results when you have fields with very similar vocabularies.
NOTE: Requires the queryparser
compilation feature.
let parser = tique::QueryParser::new(&index, vec![name, ingredients])?;
if let Some(query) = parser.parse(r#"+bacon cheese -ingredients:olive "deep fry""#) {
// Do your thing with the query...
}
This library's default dependency will always be just tantivy
, anything
that requires more will be added as optional feature.