aboutsummaryrefslogtreecommitdiff
path: root/icing/index/lite
diff options
context:
space:
mode:
authorGrace Zhao <gracezrx@google.com>2022-10-27 13:52:32 -0700
committerGrace Zhao <gracezrx@google.com>2022-10-27 21:06:49 +0000
commitd0795655ecf1aac89bb1802f4e1d3f5fb7dcb2b0 (patch)
treeff367f5a9c0f94a1da09638e5d986d5e9bcb62ff /icing/index/lite
parent4af97ca767a9f2e88dc75e05784dd010e7541d13 (diff)
downloadicing-d0795655ecf1aac89bb1802f4e1d3f5fb7dcb2b0.tar.gz
Sync from upstream.
Descriptions: ====================================================================== Fix the bug in PostingListAccessor found by the Icing Monkey test ====================================================================== Add the logic to handle fatal errors from IcingDynamicTrie to avoid crashing ====================================================================== Clear out the dead code IcingDynamicTrie::Compact ====================================================================== [MemoryMappedFile][RemapV2][1/x] Add factory method for MemoryMappedFile ====================================================================== [MemoryMappedFile][RemapV2][2/x] Create GrowAndRemapIfNecessary and change factory method ====================================================================== [MemoryMappedFile][RemapV2][3/x] Migrate FileBackedVector to use GrowAndRemapIfNecessary ====================================================================== Add JNI latency for query latency stats breakdown ====================================================================== Bug: 247671531 Bug: 247929909 Bug: 253282365 Change-Id: Ic3b88d0f044edacfe2dfeb08fa381b2186c731cb
Diffstat (limited to 'icing/index/lite')
-rw-r--r--icing/index/lite/lite-index.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/icing/index/lite/lite-index.cc b/icing/index/lite/lite-index.cc
index 8d3fea9..1ea945c 100644
--- a/icing/index/lite/lite-index.cc
+++ b/icing/index/lite/lite-index.cc
@@ -280,9 +280,12 @@ libtextclassifier3::StatusOr<uint32_t> LiteIndex::InsertTerm(
const std::string& term, TermMatchType::Code term_match_type,
NamespaceId namespace_id) {
uint32_t tvi;
- if (!lexicon_.Insert(term.c_str(), "", &tvi, false)) {
- return absl_ports::ResourceExhaustedError(
- absl_ports::StrCat("Unable to add term ", term, " to lexicon!"));
+ libtextclassifier3::Status status =
+ lexicon_.Insert(term.c_str(), "", &tvi, false);
+ if (!status.ok()) {
+ ICING_LOG(DBG) << "Unable to add term " << term << " to lexicon!\n"
+ << status.error_message();
+ return status;
}
ICING_RETURN_IF_ERROR(UpdateTermProperties(
tvi, term_match_type == TermMatchType::PREFIX, namespace_id));