Omnisearch text box in AEM assets returns values with space as first charachter.



i am having an issue in my AEM installation:

In Author instance when I go to Assets-> click Filter from the top left option icon as shown below:


and then when I start typing keywords in the omnisearch box, I recive the suggestion drop down properly, but that suggestion drop down is formed using below kind of response. It has space ahead of the value and suggestion key's value as shown in the sample response below:


"suggestions":[{"value":"  asset\\_name","suggestion":"  asset_name"}]}

Can somebody help me with how this omnisearch works technically. I looked everywhere on google but was not able to find the technical details about this omnisearch box and the typeahead suggestion drop down formtion.







Oh sorry I didn't mention that it's a know issue in AEM assets 6.4.

If there is a space inserted as the first character for search then that search will return no result even if the assets for that keyword exists.

So how would someone go and customize the response so that ali is returning results with spaces in the value ( I am sure OOTB omnisearch suggestion respond doesn't have this bug).