mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-08-01 03:10:04 +00:00
located_query_terms_from_string
: use u16 for positions, hard limit number of iterated tokens.
- Refactor phrase logic to reduce number of possible states
This commit is contained in:
@ -267,7 +267,7 @@ impl QueryGraph {
|
||||
/// Remove all the nodes that correspond to a word starting at the given position, and connect
|
||||
/// the predecessors of these nodes to their successors.
|
||||
/// Return `true` if any node was removed.
|
||||
pub fn remove_words_starting_at_position(&mut self, position: i8) -> bool {
|
||||
pub fn remove_words_starting_at_position(&mut self, position: u16) -> bool {
|
||||
let mut nodes_to_remove_keeping_edges = vec![];
|
||||
for (node_idx, node) in self.nodes.iter() {
|
||||
let QueryNodeData::Term(LocatedQueryTerm { value: _, positions }) = &node.data else { continue };
|
||||
|
Reference in New Issue
Block a user