Index concatenated fields for autocompletion

Using Atlas Search, I want to index two concatenated fields with one or more separating characters for autocompletion. For example, if this is my document:

{
    "partNo": "12345",
    "description": "Widget"
}

I want to index partNo + " - " + description (“12345 - Widget”) for an autocomplete query.

How can I do this?
Thanks!

This seems like more a display issue - where you want to autocomplete on both partNo and description, but display the concatenated string. Is that correct? You can use autocomplete and compound.should across both fields as-is.

If you’re looking for a more sophisticated as-you-type suggestion technique, check out Relevant As-You-Type Suggestions Search Solution | MongoDB

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.