I have following piece of code:
CompassQuery suggested = hits.getSuggestedQuery()
String displayedSuggestion = suggested.toString();
If just do that I get nasty string with aliases and query operators: +(alias:item) field:keyword1 OR field:keyword2
How do I get simple sitring like this?:
keyword1 keyword2
I had this same problem myself recently. The only way I could make it work reliably was code like this:
The
fieldNameparameter is the field used for the terms you want to extract (fieldin your example).