title: Liferay 7.3.5GA6 custom index search and ddmFieldArray
body: <p>I'm trying to develop a custom web content search portlet for Liferay 7.3.5 GA6, using SearchContext, IndexSearcherHelperUtil and all the other stuff.</p>
  <p>I have some DDMStructure with different fields and, from what I've seen on the elasticsearch index, this fields are indexed in a nested document, like this:</p>
  <pre><code>&quot;ddmFieldArray&quot;: [
  {
  &quot;ddmFieldName&quot;: &quot;ddm__text__37702__nome_it_IT&quot;,
  &quot;ddmValueFieldName&quot;: &quot;ddmFieldValueText_it_IT&quot;,
  &quot;ddmFieldValueText_it_IT&quot;: &quot;Nome esempio&quot;,
  &quot;ddmFieldValueText_it_IT_String_sortable&quot;: &quot;nome esempio&quot;
  }
  ,
  {
  &quot;ddmFieldName&quot;: &quot;ddm__text__37702__descrizione_breve_it_IT&quot;,
  &quot;ddmValueFieldName&quot;: &quot;ddmFieldValueText_it_IT&quot;,
  &quot;ddmFieldValueText_it_IT&quot;: &quot;Esempio di descrizione breve da indicizzare&quot;,
  &quot;ddmFieldValueText_it_IT_String_sortable&quot;: &quot;esempio di descrizione breve da indicizzare&quot;
  }
  ]
  </code></pre>
  <p>which is different from the old way I used to know, where the custom fields were indexed like <code>ddm__[keyword/text]__[structure_id]__[field_name]</code></p>
  <p>Now, I understand this different way of indexing is due to an improvement to avoid elastic issues (Limit of total fields has been exceeded) but...After executing the search, there is no <strong>ddmFieldArray</strong> in the <em>com.liferay.portal.kernel.search.Document .getFields</em>, so I'm unable to get the ddmstructure fields values from the elastic search index.</p>
  <p>Here's the code:</p>
  <pre><code>long journalArticleClassId = ClassNameLocalServiceUtil.getClassNameId(JournalArticle.class.getName());
  
  SearchContext searchContext = new SearchContext();
  searchContext.setClassTypeIds(new long[] {journalArticleClassId});
  searchContext.setCompanyId(companyId);
  searchContext.setStart(QueryUtil.ALL_POS);
  searchContext.setEnd(QueryUtil.ALL_POS);
          
  BooleanQuery query = new BooleanQueryImpl();
              
          
  MatchQuery approvedQuery = new MatchQuery(Field.STATUS, String.valueOf(WorkflowConstants.STATUS_APPROVED));
  
  query.add(approvedQuery, BooleanClauseOccur.MUST.getName());
  
  
  Hits resultHits = IndexSearcherHelperUtil.search(searchContext, query);
  
  for (Document doc: resultHits.getDocs()) {          
      doc.getFields().forEach((k, v) -&gt; _log.debug(k)); //No ddm structure field
  }
  </code></pre>
  <p>Is this still an improvement or just an unexpected behaviour?</p>
  <p>Any way to solve or extend this?</p>
  <p>Thanks</p>