octopus_query 0.1.0

query engine for arrays of integers (scoring only idf at the moment), supports AND/OR/DisMax/Constant queries
Documentation
  • Coverage
  • 64.71%
    11 out of 17 items documented1 out of 16 items with examples
  • Size
  • Source code size: 17.74 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.38 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • jackdoe/octopus_query
    6 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jackdoe

octopus - query arrays of integers

octopus is a query engine for arrays of integers (scoring only idf at the moment), supports AND/OR/DisMax/Constant queries,

Example:

let queries: &mut [&mut dyn Query] =
    &mut [&mut Term::new(1, &[1, 2, 3]), &mut Term::new(1, &[1, 7, 9])];
let mut or = Or::new(queries);

let queries: &mut [&mut dyn Query] = &mut [
    &mut Term::new(1, &[1, 2, 7]),
    &mut Term::new(1, &[1, 2, 4, 5, 7, 9]),
    &mut or,
];
let mut and = And::new(queries);

while and.next() != NO_MORE {
    println!("doc: {}, score: {}", and.doc_id(), and.score());
}