Skip to content

Commit

Permalink
refactor(storage): inverted index support calculate the score (#16609)
Browse files Browse the repository at this point in the history
* refactor(storage): inverted index support calculate the score

* fix typos

* fix clippy

* fix
  • Loading branch information
b41sh authored Oct 18, 2024
1 parent 3b7ef8b commit 5ec5c02
Show file tree
Hide file tree
Showing 10 changed files with 757 additions and 451 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions src/query/ee/tests/it/inverted_index/index_refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ async fn test_fuse_do_refresh_inverted_index() -> Result<()> {
field_ids.insert(1);
let index_record = IndexRecordOption::WithFreqsAndPositions;

let index_reader = InvertedIndexReader::create(dal.clone());

let queries = vec![
("rust".to_string(), vec![0, 1]),
("java".to_string(), vec![2]),
Expand All @@ -177,18 +175,21 @@ async fn test_fuse_do_refresh_inverted_index() -> Result<()> {
let (query, fuzziness, tokenizer_manager) =
create_inverted_index_query(&inverted_index_info)?;

let index_reader = InvertedIndexReader::create(
dal.clone(),
need_position,
has_score,
tokenizer_manager,
block_meta.row_count,
);

let matched_rows = index_reader
.clone()
.do_filter(
&settings,
need_position,
has_score,
query.box_clone(),
&field_ids,
&index_record,
&fuzziness,
tokenizer_manager,
block_meta.row_count,
&index_loc,
)
.await?;
Expand Down
12 changes: 6 additions & 6 deletions src/query/ee/tests/it/inverted_index/pruning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ async fn test_block_pruner() -> Result<()> {
}),
..Default::default()
};
let _e13 = PushDownInfo {
let e13 = PushDownInfo {
inverted_index: Some(InvertedIndexInfo {
index_name: index_name.clone(),
index_version: index_version.clone(),
Expand All @@ -720,7 +720,7 @@ async fn test_block_pruner() -> Result<()> {
}),
..Default::default()
};
let _e14 = PushDownInfo {
let e14 = PushDownInfo {
inverted_index: Some(InvertedIndexInfo {
index_name: index_name.clone(),
index_version: index_version.clone(),
Expand All @@ -733,7 +733,7 @@ async fn test_block_pruner() -> Result<()> {
}),
..Default::default()
};
let _e15 = PushDownInfo {
let e15 = PushDownInfo {
inverted_index: Some(InvertedIndexInfo {
index_name: index_name.clone(),
index_version: index_version.clone(),
Expand All @@ -759,9 +759,9 @@ async fn test_block_pruner() -> Result<()> {
(Some(e10), 2, 2),
(Some(e11), 9, 15),
(Some(e12), 2, 2),
//(Some(e13), 3, 3),
//(Some(e14), 2, 2),
//(Some(e15), 2, 5),
(Some(e13), 3, 3),
(Some(e14), 2, 2),
(Some(e15), 2, 5),
];

for (extra, expected_blocks, expected_rows) in extras {
Expand Down
Loading

0 comments on commit 5ec5c02

Please sign in to comment.