mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
Fix PR comments
This commit is contained in:
parent
ab2cf69e8d
commit
e857ca4d7d
@ -157,6 +157,8 @@ enum Command {
|
|||||||
prefixes: Vec<String>,
|
prefixes: Vec<String>,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/// Outputs a CSV with the documents ids along with
|
||||||
|
/// the field id and the word count where it appears.
|
||||||
FieldIdWordCountDocids {
|
FieldIdWordCountDocids {
|
||||||
/// Display the whole documents ids in details.
|
/// Display the whole documents ids in details.
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
@ -714,8 +716,8 @@ fn field_id_word_count_docids(
|
|||||||
.id(&field_name)
|
.id(&field_name)
|
||||||
.with_context(|| format!("unknown field name: {}", &field_name))?;
|
.with_context(|| format!("unknown field name: {}", &field_name))?;
|
||||||
|
|
||||||
let left = (field_id, 1);
|
let left = (field_id, 0);
|
||||||
let right = (field_id, 11);
|
let right = (field_id, u8::max_value());
|
||||||
let iter = index.field_id_word_count_docids
|
let iter = index.field_id_word_count_docids
|
||||||
.range(rtxn, &(left..=right))?;
|
.range(rtxn, &(left..=right))?;
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
use std::convert::TryFrom;
|
||||||
use std::mem::take;
|
use std::mem::take;
|
||||||
|
use std::ops::BitOr;
|
||||||
|
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use roaring::RoaringBitmap;
|
use roaring::RoaringBitmap;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use std::ops::BitOr;
|
|
||||||
|
|
||||||
use crate::search::query_tree::{Operation, PrimitiveQueryPart};
|
use crate::search::query_tree::{Operation, PrimitiveQueryPart};
|
||||||
use crate::search::criteria::{
|
use crate::search::criteria::{
|
||||||
@ -162,8 +163,8 @@ fn resolve_state(
|
|||||||
use State::*;
|
use State::*;
|
||||||
match state {
|
match state {
|
||||||
ExactAttribute(mut allowed_candidates) => {
|
ExactAttribute(mut allowed_candidates) => {
|
||||||
let query_len = query.len() as u8;
|
|
||||||
let mut candidates = RoaringBitmap::new();
|
let mut candidates = RoaringBitmap::new();
|
||||||
|
if let Ok(query_len) = u8::try_from(query.len()) {
|
||||||
let attributes_ids = ctx.searchable_fields_ids()?;
|
let attributes_ids = ctx.searchable_fields_ids()?;
|
||||||
for id in attributes_ids {
|
for id in attributes_ids {
|
||||||
if let Some(attribute_allowed_docids) = ctx.field_id_word_count_docids(id, query_len)? {
|
if let Some(attribute_allowed_docids) = ctx.field_id_word_count_docids(id, query_len)? {
|
||||||
@ -177,8 +178,9 @@ fn resolve_state(
|
|||||||
candidates &= &allowed_candidates;
|
candidates &= &allowed_candidates;
|
||||||
// remove current candidates from allowed candidates
|
// remove current candidates from allowed candidates
|
||||||
allowed_candidates -= &candidates;
|
allowed_candidates -= &candidates;
|
||||||
Ok((candidates, Some(AttributeStartsWith(allowed_candidates))))
|
}
|
||||||
|
|
||||||
|
Ok((candidates, Some(AttributeStartsWith(allowed_candidates))))
|
||||||
},
|
},
|
||||||
AttributeStartsWith(mut allowed_candidates) => {
|
AttributeStartsWith(mut allowed_candidates) => {
|
||||||
let mut candidates = RoaringBitmap::new();
|
let mut candidates = RoaringBitmap::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user