Fetching union of query result in Completion Suggester

I'm trying to create something like or query in completion suggester of elastic search. I need to fetch the autosuggestion from multiple fields. I tried something like below code and it doesn't return any result. So, to be precise I want to fetch autosuggest data from field A and field B using the below code. How should I form the query?

String[] terms = StringUtils.split( dwQuery.getSearchPhrase() );
CompletionSuggestionBuilder skillNameSuggest = null;

        skillNameSuggest = new CompletionSuggestionBuilder( "complete" );
        skillNameSuggest.text( term );
        skillNameSuggest.field( "fieldA" )
            .field( "fieldB" );


    return skillNameSuggest;

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