Fix frozen array error with custom analyzers
What does this MR do and why?
Resolve "Use by_full_text in other query builders" (!179052 - merged) introduced a bug when custom analyzers are enabled for Advanced search. This MR fixes the issue by calling .dup on the fields to handle constant if it's passed in
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
I'm validating this with specs, it's pretty difficult to setup the analyzers manually. The specs I added fail with the same error reported
FrozenError (can't modify frozen Array: [...]):