Skip to content

Commit

Permalink
Merge pull request #24022 from vespa-engine/toregge/handle-juniper-fo…
Browse files Browse the repository at this point in the history
…r-array-of-string

Handle juniper callbacks for array of string.
  • Loading branch information
geirst authored Sep 12, 2022
2 parents 5f654b6 + 94c4772 commit cf494ca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ DynamicTeaserDFW::insert_juniper_field(uint32_t docid, vespalib::stringref input

if (teaser != nullptr) {
inserter.insertString({teaser->Text(), teaser->Length()});
} else {
inserter.insertString({});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ SlimeFiller::SlimeFiller(Inserter& inserter, bool tokenize, const std::vector<ui
{
}

SlimeFiller::SlimeFiller(Inserter& inserter, bool tokenize, IJuniperConverter& juniper_converter)
SlimeFiller::SlimeFiller(Inserter& inserter, bool tokenize, IJuniperConverter* juniper_converter)
: _inserter(inserter),
_tokenize(tokenize),
_matching_elems(nullptr),
_juniper_converter(&juniper_converter)
_juniper_converter(juniper_converter)
{
}

Expand Down Expand Up @@ -163,7 +163,7 @@ SlimeFiller::visit(const ArrayFieldValue& value)
}
Cursor& a = _inserter.insertArray();
ArrayInserter ai(a);
SlimeFiller conv(ai, _tokenize);
SlimeFiller conv(ai, _tokenize, _juniper_converter);
if (filter_matching_elements()) {
for (uint32_t id_to_keep : (*_matching_elems)) {
value[id_to_keep].accept(conv);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SlimeFiller : public document::ConstFieldValueVisitor {
public:
SlimeFiller(vespalib::slime::Inserter& inserter, bool tokenize);
SlimeFiller(vespalib::slime::Inserter& inserter, bool tokenize, const std::vector<uint32_t>* matching_elems);
SlimeFiller(vespalib::slime::Inserter& inserter, bool tokenize, IJuniperConverter& juniper_converter);
SlimeFiller(vespalib::slime::Inserter& inserter, bool tokenize, IJuniperConverter* juniper_converter);
~SlimeFiller() override;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ SummaryFieldConverter::insert_juniper_field(const document::FieldValue& value, v
CheckUndefinedValueVisitor check_undefined;
value.accept(check_undefined);
if (!check_undefined.is_undefined()) {
SlimeFiller visitor(inserter, tokenize, converter);
SlimeFiller visitor(inserter, tokenize, &converter);
value.accept(visitor);
}
}
Expand Down

0 comments on commit cf494ca

Please sign in to comment.