Gravatar for hernandez@rdacorp.com

Question by benaldo, Dec 14, 2016 2:39 PM

External field not returning from API

Hi,

I'm having a problem with external field data not showing up in the json object. This is after a recent upgrade to Coveo 4.0, and is an on-premise solution. The field is configured in an externalfields config file like so:

  fieldType fieldName="categoryhierarchy" isExternal="true" isSortable="false" isFacet="true" includeForFreeTextSearch="false" isMultiValue="true"

I've verified in the showconfig that the field is getting patched in correctly, and I can see data for this field present for rows in the index browser.

However, I can't create a facet based on this field, and it is not being returned with any of my api results.

Here are the request queries:

aq:((@syssource==("Coveo_web_index - STCR-STG-CMS01-Sitecore8","Products","Eprise-YTS") OR @syscollection==("Eprise","Oracle")) (((@syssource*="*Coveo*") (@ffullpath23680*="/sitecore/content/TCOM/Knowledge Center*") (@fhaslayout23680=="1")) OR ((@syssource=="Products") (@salesgroupids=="229") (@sellingrestrictioncode=="n/a"))) NOT @ftemplateid23680==("adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97","fe5dd826-48c6-436d-b87a-7c4210c7413b") $qre(expression:(@manufacturer=="PCTEL") (@subtabname=="Mobile Antennas"), modifier:'50')) (@statuscode <> "O") ($qre(expression:@manufacturer *= "*iphon*", modifier:'50')) 

cq:((@fz95xlanguage23680=="en" @fz95xlatestversion23680=="1") OR @syssource==("Products","Eprise-YTS") OR @syscollection==("Eprise","Oracle"))

The field in question here exists in the Products source.

I also have the field listed in the groupby query:

{
"field":"@categoryhierarchy",
"maximumNumberOfValues":1000,
"sortCriteria":"occurrences",
"injectionDepth":1000,
"completeFacetWithStandardValues":true
}

The field is a multi-value field, formatted like this in the browser:

@categoryhierarchy    String  Cases & Holsters;Cases & Holsters|Fitted Phone Cases;Cases & Holsters|Fitted Phone Cases|Slim Protection;

I've also tried a rebuild of that index with no luck.

Any idea as to why this field would not be returning with the other info in the source? Let me know if there is other information that would be helpful to have here. Thanks!

Gravatar for sbelzile@coveo.com

Comment by Sébastien Belzile, Dec 14, 2016 2:59 PM

I can't create a facet based on this field, and it is not being returned with any of my api results.

Did you add a facet item in the bucket/facet folder?

Your field exits on the documents returned by your query, right?

Gravatar for hernandez@rdacorp.com

Comment by benaldo, Dec 14, 2016 3:01 PM

Yes, a facet item exists for this field; I also verified it exists in documents I'm returning using the Index Browser. They're just not being returned from the search api query

1 Reply
Gravatar for flguillemette@coveo.com

Answer by François Lachance-Guillemette, Dec 14, 2016 2:44 PM

Hi @benaldo! :)

External fields should be configured in the externalFields node, under the fieldMap node in your configuration.

<externalFields hint="raw:AddExternalField">
     <field fieldName="categoryhierarchy" />
</externalFields>

Let me know if this worked for you :)

FLG

Gravatar for hernandez@rdacorp.com

Comment by benaldo, Dec 14, 2016 2:59 PM

Hi @flguillemette, thanks for your response.

I added that field to the external fields definition under the fieldMap node. Still not seeing it return in the json. Would I need to rebuild the index for this to work? It already is showing from the index browser.

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Dec 14, 2016 3:31 PM

Since the result does not come back from CES, I would check in the fields configuration in the CES Admin Tool to see if the field is excluded from results. You can find it under Configuration > Fields > [your field set] > First Column (Field Queries)

Gravatar for hernandez@rdacorp.com

Comment by benaldo, Dec 14, 2016 5:08 PM

That field is set as included in field queries. Rebuilding the index didn't work either. Anything else that would cause the field to not return in the raw section of the json result?

Ask a question