How to create jql field like andvance search in Jira system?

I have a design for plugin have a jql field like advance search in jira.

Right now I just have a like this

How should I make it become autocomplete with jql element suggestion
After search I know the api to get suggestion

  • “rest/api/2/jql/autocompletedata”

  • " rest/api/2/jql/autocompletedata/suggestions "

How can I make it the same as advance search?
And what is autocomplete algorithm behind jql advance seach?

Thank you

Did u find any solution for ur Problem ?