Actually what you are asking does not make any sense. Solr response is returning that data structure because it must return as much as possible. It is responsibility of the client to get what it needs from the response.
Talking about the Java Client, I contributed the SolrJ code to parse the Suggester response[1]. I will provide a final patch soon. With my implementationn it is possible to use SolrJ to give you a simple List of String for the suggested terms. [1] https://issues.apache.org/jira/browse/SOLR-7719 Cheers 2015-06-30 14:28 GMT+01:00 ssharma7...@gmail.com <ssharma7...@gmail.com>: > Hi, > Is it possible to restrict the result returned by Suggeter to "selected" > fields only? > i.e. Currently, Suggester returns data in following structure (XML), > Can I restrict the Solr (5.1) Suggestor to return ONLY "term" & EXCLUDE > <long name="weight"> & > <str name="payload"/> as per Suggeter result XML below ? > > > <?xml version="1.0" encoding="UTF-8"?> > <response> > > <lst name="responseHeader"> > <int name="status">0</int> > <int name="QTime">16</int> > </lst> > <lst name="suggest"> > <lst name="docNameSuggester"> > <lst name="document"> > <int name="numFound">5</int> > <arr name="suggestions"> > <lst> > *<str name="term">document</str>* > <long name="weight">512409557603043072</long> > <str name="payload"/> > </lst> > <lst> > *<str name="term">document1</str>* > <long name="weight">512409557603043072</long> > <str name="payload"/> > </lst> > <lst> > *<str name="term">document2</str>* > <long name="weight">512409557603043072</long> > <str name="payload"/> > </lst> > <lst> > *<str name="term">document3</str>* > <long name="weight">512409557603043072</long> > <str name="payload"/> > </lst> > <lst> > *<str name="term">document4</str>* > <long name="weight">512409557603043072</long> > <str name="payload"/> > </lst> > </arr> > </lst> > </lst> > <lst name="textSuggester"> > <lst name="document"> > <int name="numFound">3</int> > <arr name="suggestions"> > <lst> > *<str name="term">document</str>* > <long name="weight">10933347601771902</long> > <str name="payload"/> > </lst> > <lst> > *<str name="term">documents</str>* > <long name="weight">4373339040708760</long> > <str name="payload"/> > </lst> > <lst> > *<str name="term">documenting</str>* > <long name="weight">2186669520354380</long> > <str name="payload"/> > </lst> > </arr> > </lst> > </lst> > </lst> > </response> > > > Regards, > Sachin Vyas. > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Restricting-fields-returned-by-Suggester-reult-tp4214948.html > Sent from the Solr - User mailing list archive at Nabble.com. > -- -------------------------- Benedetti Alessandro Visiting card : http://about.me/alessandro_benedetti "Tyger, tyger burning bright In the forests of the night, What immortal hand or eye Could frame thy fearful symmetry?" William Blake - Songs of Experience -1794 England