(If no other SolrJ specific advice shows up).... Can you divide the problem in a middle a see what happens and whether the issue is Solr or SolrJ side.
Specifically, execute the query directly against Solr and see what happens. Also I would triple-check that the documents you are getting back actually have the field. Sometimes not all documents do and the query returns those wirhout first. Cross check by getting returned IDs and looking up the full record directly in Solr. Regards, Alex On Thu, Jun 27, 2019, 1:37 PM Steve Pruitt, <bpru...@opentext.com> wrote: > I cannot get Solr to return a stored field. > > My schema is: > > : > <field name="user" type="plong" indexed="true" stored="true"/> > <field name="ranking" type="pdouble" indexed="false" stored="true"/> > <field name="reference" type="string" indexed="false" stored="true"/> > : > > I am using the SolrJ client and trying this: > > The query string contains = " user: " and a list of user field values; > The query executes ok. I get several documents. > > SolrQuery solrQuery = new SolrQuery(query); > solrQuery.setSort("ranking" , SolrQuery.ORDER.desc); > solrQuery.addField("ranking"); > solrQuery.addField("reference"); > > I also tried: > > solrQuery.setFields("ranking", " reference"); > > But the result has only the "ranking" field. > Before explicitly setting the fields. All fields came back in response > except "reference". >