Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update iresearch #19342

Merged
merged 2 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdParty/iresearch
Submodule iresearch updated 86 files
+3 −0 CMakeLists.txt
+5 −3 core/formats/columnstore.cpp
+1 −4 core/formats/columnstore2.cpp
+9 −4 core/formats/columnstore2.hpp
+8 −1 core/formats/formats.hpp
+62 −39 core/formats/formats_10.cpp
+19 −10 core/formats/formats_burst_trie.cpp
+14 −10 core/formats/skip_list.cpp
+4 −3 core/formats/skip_list.hpp
+213 −154 core/formats/wand_writer.hpp
+11 −9 core/index/buffered_column_iterator.hpp
+6 −0 core/index/composite_reader_impl.hpp
+4 −0 core/index/directory_reader.cpp
+2 −0 core/index/directory_reader.hpp
+2 −0 core/index/index_reader.cpp
+3 −0 core/index/index_reader.hpp
+1 −1 core/index/merge_writer.cpp
+4 −0 core/index/segment_reader.cpp
+2 −0 core/index/segment_reader.hpp
+10 −0 core/index/segment_reader_impl.cpp
+3 −1 core/index/segment_reader_impl.hpp
+41 −13 core/search/bm25.cpp
+2 −0 core/search/bm25.hpp
+35 −0 core/search/scorer.cpp
+17 −3 core/search/scorer.hpp
+0 −2 core/search/scorer_impl.hpp
+21 −16 core/search/tfidf.cpp
+2 −0 core/search/tfidf.hpp
+8 −0 core/store/data_input.hpp
+2 −26 core/store/directory_attributes.cpp
+1 −33 core/store/directory_attributes.hpp
+11 −0 core/store/fs_directory.cpp
+3 −5 core/store/memory_directory.cpp
+5 −31 core/store/memory_directory.hpp
+49 −0 core/store/mmap_directory.cpp
+2 −3 core/utils/async_utils.cpp
+2 −2 core/utils/async_utils.hpp
+2 −2 core/utils/automaton_utils.hpp
+73 −266 core/utils/container_utils.hpp
+39 −0 core/utils/empty.hpp
+1 −0 core/utils/encryption.cpp
+3 −3 core/utils/file_utils.cpp
+2 −2 core/utils/file_utils.hpp
+7 −3 core/utils/fstext/fst_builder.hpp
+4 −4 core/utils/fstext/fst_string_ref_weight.hpp
+12 −8 core/utils/fstext/fst_string_weight.hpp
+2 −2 core/utils/hash_utils.hpp
+2 −2 core/utils/levenshtein_utils.hpp
+26 −17 core/utils/string.hpp
+4 −4 core/utils/thread_utils.cpp
+2 −1 core/utils/thread_utils.hpp
+18 −0 microbench/CMakeLists.txt
+34 −0 microbench/memory_file_benchmark.cpp
+3 −0 microbench/top_term_collector_benchmark.cpp
+5 −5 tests/formats/formats_11_tests.cpp
+5 −5 tests/formats/formats_12_tests.cpp
+5 −5 tests/formats/formats_13_tests.cpp
+2 −2 tests/formats/formats_14_tests.cpp
+3 −3 tests/formats/formats_15_tests.cpp
+9 −9 tests/formats/formats_test_case_base.cpp
+4 −4 tests/index/buffered_column_test.cpp
+2 −0 tests/index/consolidation_policy_tests.cpp
+12 −1 tests/index/doc_generator.cpp
+4 −0 tests/index/doc_generator.hpp
+33 −49 tests/index/index_tests.cpp
+3 −2 tests/index/index_tests.hpp
+22 −0 tests/index/sorted_index_tests.cpp
+392 −0 tests/resources/simple_single_column_multi_term_norm.json
+2 −2 tests/search/filter_test_case_base.hpp
+41 −23 tests/search/prefix_filter_test.cpp
+3 −0 tests/search/top_terms_collector_test.cpp
+47 −5 tests/search/wand_test.cpp
+3 −51 tests/store/directory_test_case.cpp
+1 −1 tests/store/memory_index_output_tests.cpp
+3 −3 tests/tests_main.cpp
+2 −2 tests/tests_param.hpp
+1 −1 tests/utils/async_utils_tests.cpp
+44 −258 tests/utils/container_utils_tests.cpp
+3 −3 tests/utils/encryption_test.cpp
+1 −1 tests/utils/fst_builder_test.cpp
+2 −2 tests/utils/levenshtein_utils_test.cpp
+1 −1 tests/utils/thread_pool_test.cpp
+8 −8 tests/utils/utf8_path_tests.cpp
+107 −17 utils/index-put.cpp
+6 −1 utils/index-search.cpp
+12 −4 utils/main.cpp
4 changes: 2 additions & 2 deletions arangod/IResearch/IResearchRocksDBInvertedIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ std::shared_ptr<Index> IResearchRocksDBInvertedIndexFactory::instantiate(
auto* encryption = engine.encryptionProvider();
if (encryption) {
return irs::directory_attributes{
0, std::make_unique<RocksDBEncryptionProvider>(
*encryption, engine.rocksDBOptions())};
std::make_unique<RocksDBEncryptionProvider>(
*encryption, engine.rocksDBOptions())};
}
return irs::directory_attributes{};
});
Expand Down
4 changes: 2 additions & 2 deletions arangod/IResearch/IResearchRocksDBLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ std::shared_ptr<Index> IResearchRocksDBLink::IndexFactory::instantiate(
auto* encryption = engine.encryptionProvider();
if (encryption) {
return irs::directory_attributes{
0, std::make_unique<RocksDBEncryptionProvider>(
*encryption, engine.rocksDBOptions())};
std::make_unique<RocksDBEncryptionProvider>(
*encryption, engine.rocksDBOptions())};
}
return irs::directory_attributes{};
});
Expand Down
4 changes: 2 additions & 2 deletions arangod/IResearch/VelocyPackHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace iresearch {
namespace {
template<typename T>
velocypack::Builder& addRef(velocypack::Builder& builder,
std::basic_string_view<T> value) {
irs::basic_string_view<T> value) {
// store nulls verbatim
if (irs::IsNull(value)) {
builder.add( // add value
Expand All @@ -51,7 +51,7 @@ velocypack::Builder& addRef(velocypack::Builder& builder,

template<typename T>
velocypack::Builder& addRef(velocypack::Builder& builder, std::string_view key,
std::basic_string_view<T> value) {
irs::basic_string_view<T> value) {
// Builder uses memcpy(...) which cannot handle nullptr
TRI_ASSERT(!irs::IsNull(key));

Expand Down
8 changes: 4 additions & 4 deletions arangod/IResearch/VelocyPackHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@ uint8_t const COMPACT_ARRAY = 0x13;
uint8_t const COMPACT_OBJECT = 0x14;

template<typename Char>
std::basic_string_view<Char> ref(VPackSlice slice) {
irs::basic_string_view<Char> ref(VPackSlice slice) {
static_assert(sizeof(Char) == sizeof(uint8_t),
"sizeof(Char) != sizeof(uint8_t)");

return std::basic_string_view<Char>(
return irs::basic_string_view<Char>(
reinterpret_cast<Char const*>(slice.begin()), slice.byteSize());
}

template<typename Char>
VPackSlice slice(std::basic_string_view<Char> const& ref) {
VPackSlice slice(irs::basic_string_view<Char> const& ref) {
static_assert(sizeof(Char) == sizeof(uint8_t),
"sizeof(Char) != sizeof(uint8_t)");

return VPackSlice(reinterpret_cast<uint8_t const*>(ref.data()));
}

template<typename Char>
VPackSlice slice(std::basic_string<Char> const& ref) {
VPackSlice slice(irs::basic_string<Char> const& ref) {
static_assert(sizeof(Char) == sizeof(uint8_t),
"sizeof(Char) != sizeof(uint8_t)");

Expand Down
2 changes: 2 additions & 0 deletions arangod/IResearch/ViewSnapshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class ViewSnapshot : public irs::IndexReader {
using ImmutablePartCache =
std::map<aql::AstNode const*, irs::proxy_filter::cache_ptr>;

void CountMemory(const irs::MemoryStats& /*stats*/) const final {}

/// @return cid of the sub-reader at operator['offset'] or 0 if undefined
[[nodiscard]] virtual DataSourceId cid(std::size_t offset) const noexcept = 0;

Expand Down
6 changes: 3 additions & 3 deletions tests/IResearch/IResearchLinkTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ TEST_F(
auto linkCallbackRemover =
arangodb::iresearch::IResearchLinkMock::setCallbackForScope([]() {
return irs::directory_attributes{
0, std::make_unique<irs::mock::test_encryption>(kEncBlockSize)};
std::make_unique<irs::mock::test_encryption>(kEncBlockSize)};
});
static std::vector<std::string> const kEmpty;
auto doc0 = arangodb::velocypack::Parser::fromJson(
Expand Down Expand Up @@ -1572,8 +1572,8 @@ TEST_F(
.string();
irs::FSDirectory directory(
dataPath,
irs::directory_attributes(
0, std::make_unique<irs::mock::test_encryption>(kEncBlockSize)));
irs::directory_attributes{
std::make_unique<irs::mock::test_encryption>(kEncBlockSize)});

bool created;
auto link = logicalCollection->createIndex(linkJson->slice(), created);
Expand Down
2 changes: 1 addition & 1 deletion tests/IResearch/IResearchQueryTokensTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class TestDelimAnalyzer final
}

private:
std::basic_string<irs::byte_type> _delim;
irs::bstring _delim;
irs::bytes_view _data;
irs::term_attribute _term;
};
Expand Down