-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support applying BlockMaxWand algorithm to PhraseDocIterator (#2369)
### What problem does this PR solve? Now BlockMaxWandIterator can accept both TermDocIterator and PhraseDocIterator as children Issue link:#1320 ### Type of change - [x] New Feature (non-breaking change which adds functionality) - [x] Refactoring - [x] Performance Improvement
- Loading branch information
Showing
11 changed files
with
245 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/storage/invertedindex/search/blockmax_leaf_iterator.cppm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
module; | ||
|
||
export module blockmax_leaf_iterator; | ||
|
||
import stl; | ||
import internal_types; | ||
import doc_iterator; | ||
|
||
namespace infinity { | ||
|
||
export class BlockMaxLeafIterator : public DocIterator { | ||
public: | ||
virtual RowID BlockMinPossibleDocID() const = 0; | ||
|
||
virtual RowID BlockLastDocID() const = 0; | ||
|
||
virtual float BlockMaxBM25Score() = 0; | ||
|
||
// Move block cursor to ensure its last_doc_id is no less than given doc_id. | ||
// Returns false and update doc_id_ to INVALID_ROWID if the iterator is exhausted. | ||
// Note that this routine decode skip_list only, and doesn't update doc_id_ when returns true. | ||
// Caller may invoke BlockMaxBM25Score() after this routine. | ||
virtual bool NextShallow(RowID doc_id) = 0; | ||
|
||
virtual float BM25Score() = 0; | ||
}; | ||
|
||
} // namespace infinity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.