Skip to content

feat(search): index all fields of submission for keyword search

Ben Whitmore requested to merge 1486-search-entire-submission-object into main

See #1486 (closed). Previously, we were only indexing specific fields of the submission object for keyword search. This MR causes all fields of the submission to be indexed if they contain text other than the values "true" or "false" (these are common string values stored for checkbox groups, but not very useful for indexing). We also iterate down through arrays and objects in the JSON, so this will index text contained in fields such as AuthorsList and LinksList.

Note that this indexes the text contained in the data, which in the case of Select and RadioGroup fields will be the internal option names rather than the labels that users see for those options. To index the option labels instead would be substantially more complex work, requiring us to examine the form at the same time as the data. This will become even more complex once we implement multiple languages for forms and nested forms. For now I think this is a good improvement and addresses the issue in the ticket, and we can revisit later if needed.

Merge request reports