mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 03:55:07 +08:00
Remove prefix dbs
This commit is contained in:
parent
86b314626d
commit
21c6123a36
@ -192,6 +192,7 @@ impl<'ctx> SearchContext<'ctx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn word_prefix_docids(&mut self, prefix: Word) -> Result<Option<RoaringBitmap>> {
|
pub fn word_prefix_docids(&mut self, prefix: Word) -> Result<Option<RoaringBitmap>> {
|
||||||
|
unreachable!();
|
||||||
match prefix {
|
match prefix {
|
||||||
Word::Original(prefix) => {
|
Word::Original(prefix) => {
|
||||||
let exact = self.get_db_exact_word_prefix_docids(prefix)?;
|
let exact = self.get_db_exact_word_prefix_docids(prefix)?;
|
||||||
@ -216,6 +217,7 @@ impl<'ctx> SearchContext<'ctx> {
|
|||||||
&mut self,
|
&mut self,
|
||||||
prefix: Interned<String>,
|
prefix: Interned<String>,
|
||||||
) -> Result<Option<RoaringBitmap>> {
|
) -> Result<Option<RoaringBitmap>> {
|
||||||
|
unreachable!();
|
||||||
match &self.restricted_fids {
|
match &self.restricted_fids {
|
||||||
Some(restricted_fids) => {
|
Some(restricted_fids) => {
|
||||||
let interned = self.word_interner.get(prefix).as_str();
|
let interned = self.word_interner.get(prefix).as_str();
|
||||||
@ -244,6 +246,7 @@ impl<'ctx> SearchContext<'ctx> {
|
|||||||
&mut self,
|
&mut self,
|
||||||
prefix: Interned<String>,
|
prefix: Interned<String>,
|
||||||
) -> Result<Option<RoaringBitmap>> {
|
) -> Result<Option<RoaringBitmap>> {
|
||||||
|
unreachable!();
|
||||||
DatabaseCache::get_value::<_, _, RoaringBitmapCodec>(
|
DatabaseCache::get_value::<_, _, RoaringBitmapCodec>(
|
||||||
self.txn,
|
self.txn,
|
||||||
prefix,
|
prefix,
|
||||||
@ -297,6 +300,7 @@ impl<'ctx> SearchContext<'ctx> {
|
|||||||
prefix2: Interned<String>,
|
prefix2: Interned<String>,
|
||||||
proximity: u8,
|
proximity: u8,
|
||||||
) -> Result<Option<RoaringBitmap>> {
|
) -> Result<Option<RoaringBitmap>> {
|
||||||
|
unreachable!();
|
||||||
DatabaseCache::get_value::<_, _, CboRoaringBitmapCodec>(
|
DatabaseCache::get_value::<_, _, CboRoaringBitmapCodec>(
|
||||||
self.txn,
|
self.txn,
|
||||||
(proximity, word1, prefix2),
|
(proximity, word1, prefix2),
|
||||||
@ -315,6 +319,7 @@ impl<'ctx> SearchContext<'ctx> {
|
|||||||
right: Interned<String>,
|
right: Interned<String>,
|
||||||
proximity: u8,
|
proximity: u8,
|
||||||
) -> Result<Option<RoaringBitmap>> {
|
) -> Result<Option<RoaringBitmap>> {
|
||||||
|
unreachable!();
|
||||||
DatabaseCache::get_value::<_, _, CboRoaringBitmapCodec>(
|
DatabaseCache::get_value::<_, _, CboRoaringBitmapCodec>(
|
||||||
self.txn,
|
self.txn,
|
||||||
(proximity, left_prefix, right),
|
(proximity, left_prefix, right),
|
||||||
@ -352,6 +357,7 @@ impl<'ctx> SearchContext<'ctx> {
|
|||||||
word_prefix: Interned<String>,
|
word_prefix: Interned<String>,
|
||||||
fid: u16,
|
fid: u16,
|
||||||
) -> Result<Option<RoaringBitmap>> {
|
) -> Result<Option<RoaringBitmap>> {
|
||||||
|
unreachable!();
|
||||||
// if the requested fid isn't in the restricted list, return None.
|
// if the requested fid isn't in the restricted list, return None.
|
||||||
if self.restricted_fids.as_ref().map_or(false, |fids| !fids.contains(&fid)) {
|
if self.restricted_fids.as_ref().map_or(false, |fids| !fids.contains(&fid)) {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
@ -393,6 +399,7 @@ impl<'ctx> SearchContext<'ctx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_db_word_prefix_fids(&mut self, word_prefix: Interned<String>) -> Result<Vec<u16>> {
|
pub fn get_db_word_prefix_fids(&mut self, word_prefix: Interned<String>) -> Result<Vec<u16>> {
|
||||||
|
unreachable!();
|
||||||
let fids = match self.db_cache.word_prefix_fids.entry(word_prefix) {
|
let fids = match self.db_cache.word_prefix_fids.entry(word_prefix) {
|
||||||
Entry::Occupied(fids) => fids.get().clone(),
|
Entry::Occupied(fids) => fids.get().clone(),
|
||||||
Entry::Vacant(entry) => {
|
Entry::Vacant(entry) => {
|
||||||
@ -439,6 +446,7 @@ impl<'ctx> SearchContext<'ctx> {
|
|||||||
word_prefix: Interned<String>,
|
word_prefix: Interned<String>,
|
||||||
position: u16,
|
position: u16,
|
||||||
) -> Result<Option<RoaringBitmap>> {
|
) -> Result<Option<RoaringBitmap>> {
|
||||||
|
unreachable!();
|
||||||
DatabaseCache::get_value::<_, _, CboRoaringBitmapCodec>(
|
DatabaseCache::get_value::<_, _, CboRoaringBitmapCodec>(
|
||||||
self.txn,
|
self.txn,
|
||||||
(word_prefix, position),
|
(word_prefix, position),
|
||||||
@ -480,6 +488,7 @@ impl<'ctx> SearchContext<'ctx> {
|
|||||||
&mut self,
|
&mut self,
|
||||||
word_prefix: Interned<String>,
|
word_prefix: Interned<String>,
|
||||||
) -> Result<Vec<u16>> {
|
) -> Result<Vec<u16>> {
|
||||||
|
unreachable!();
|
||||||
let positions = match self.db_cache.word_prefix_positions.entry(word_prefix) {
|
let positions = match self.db_cache.word_prefix_positions.entry(word_prefix) {
|
||||||
Entry::Occupied(positions) => positions.get().clone(),
|
Entry::Occupied(positions) => positions.get().clone(),
|
||||||
Entry::Vacant(entry) => {
|
Entry::Vacant(entry) => {
|
||||||
|
@ -470,13 +470,13 @@ where
|
|||||||
let all_documents_ids = index_documents_ids | new_documents_ids;
|
let all_documents_ids = index_documents_ids | new_documents_ids;
|
||||||
self.index.put_documents_ids(self.wtxn, &all_documents_ids)?;
|
self.index.put_documents_ids(self.wtxn, &all_documents_ids)?;
|
||||||
|
|
||||||
self.execute_prefix_databases(
|
// self.execute_prefix_databases(
|
||||||
word_docids,
|
// word_docids,
|
||||||
exact_word_docids,
|
// exact_word_docids,
|
||||||
word_pair_proximity_docids,
|
// word_pair_proximity_docids,
|
||||||
word_position_docids,
|
// word_position_docids,
|
||||||
word_fid_docids,
|
// word_fid_docids,
|
||||||
)?;
|
// )?;
|
||||||
|
|
||||||
Ok(all_documents_ids.len())
|
Ok(all_documents_ids.len())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user