Internal search: Return all document ids when no filters are provided
This commit is contained in:
@@ -53,13 +53,9 @@ impl Store {
|
||||
.details("Account ID must be specified before other filters"));
|
||||
}
|
||||
|
||||
#[cfg(feature = "test_mode")]
|
||||
{
|
||||
if query.filters.len() == 1 {
|
||||
state.bm = Some(mask.clone());
|
||||
}
|
||||
}
|
||||
let mut results;
|
||||
|
||||
if query.filters.len() > 1 {
|
||||
let mut filters = query.filters.into_iter().peekable();
|
||||
while let Some(filter) = filters.next() {
|
||||
let mut result = match filter {
|
||||
@@ -98,7 +94,9 @@ impl Store {
|
||||
for token in Stemmer::new(&value, language, MAX_TOKEN_LENGTH) {
|
||||
let mut tokens = Vec::with_capacity(3);
|
||||
tokens.push(CheekyHash::new(token.word.as_bytes()));
|
||||
tokens.push(CheekyHash::new(format!("{}*", token.word).as_bytes()));
|
||||
tokens.push(CheekyHash::new(
|
||||
format!("{}*", token.word).as_bytes(),
|
||||
));
|
||||
if let Some(stemmed_word) = token.stemmed_word {
|
||||
tokens.push(CheekyHash::new(
|
||||
format!("{stemmed_word}*").as_bytes(),
|
||||
@@ -188,7 +186,14 @@ impl Store {
|
||||
}
|
||||
};
|
||||
|
||||
range_to_bitmap(self, query.index, account_id, field.u8_id(), &value, op)
|
||||
range_to_bitmap(
|
||||
self,
|
||||
query.index,
|
||||
account_id,
|
||||
field.u8_id(),
|
||||
&value,
|
||||
op,
|
||||
)
|
||||
.await?
|
||||
} else {
|
||||
return Err(trc::StoreEvent::UnexpectedError
|
||||
@@ -259,8 +264,12 @@ impl Store {
|
||||
}
|
||||
}
|
||||
|
||||
let mut results = state.bm.unwrap_or_default();
|
||||
results = state.bm.unwrap_or_default();
|
||||
results.bitand_assign(&mask);
|
||||
} else {
|
||||
results = mask;
|
||||
}
|
||||
|
||||
if results.len() > 1 && !query.comparators.is_empty() {
|
||||
let mut comparators = Vec::with_capacity(query.comparators.len());
|
||||
for comparator in query.comparators {
|
||||
|
||||
Reference in New Issue
Block a user