Gravatar for ratnakumar.ravva@accenture.com

Question by ratnakumar_ravva, Sep 16, 2015 1:23 PM

Computed Filed is not being indexed from external coveo collection

Hi All,

I’m using coveoforsitecore for site search collections.

I’m facing an issue that when an item with multilist is crawled – the values are read as guid separated by “;”.

Following several suggestions, I’m trying to use computed field to solve my issue –

  1. I created a computed field. <field fieldName="sampleField">TestProject.CoveoCumputedField, TestProject</field>
  2. Reindex Coveo master index and the field is successfully getting added to coveomasterindex.
  3. Created field for “sampleField” in another collection(testcollection) source field set(mapped to computed filed).
  4. Created another field for “hasChildern” computed field (provided by Sitecore) in collection(testcollection) source field set.

Issue – “sample field” is not getting crawled to indexed documents in testcollection.

However “haschilder” is getting crawled to indexed documents in testcollection.

Thanks,

Ratnkumar ravva

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Sep 16, 2015 2:19 PM

Hi,

As I understand it, you have a Sitecore instance that is indexed in CES. You have configured the "sampleField" and "hasChildren" fields in your Coveo.SearchProvider.config file and they are filled correctly in documents of your Sitecore CES sources.

You also have another CES collection with a source for external content. You are probably using the external source or external collection feature in your Coveo for Sitecore search page to display results from Sitecore and your external source.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Sep 16, 2015 2:19 PM

You are trying to set values to the "sampleField" and "hasChildren" CES fields on your external source indexed documents. This operation depends a lot on what you are indexing in this CES source, what its connector and what are the metadatas available on your original documents.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Sep 16, 2015 2:19 PM

Can you answer to the following questions please?

  1. What is the connector used for your external source?
  2. What is the content of the original documents you are indexing?
  3. What is the "metadata name" that is configured on the "sampleField" custom field in the field set of your external source?
  4. What is the "default value" that is configured on the "sampleField" custom field in the field set of your external source?
Gravatar for ratnakumar.ravva@accenture.com

Comment by ratnakumar_ravva, Sep 17, 2015 6:05 AM

  1. What is the connector used for your external source? -- Sitecore Connector
  2. What is the content of the original documents you are indexing? -- Original document contains all fields like name, id, sampleField(multilist) with data.
  3. What is the "metadata name" that is configured on the "sampleField" custom field in the field set of your external source? -- I gave sampleField as metadata name in custom field
  4. What is the "default value" that is configured on the "sampleField" custom field in the field set of your external source? -- No Default value
Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Sep 17, 2015 10:13 AM

If I understand correclty:

  1. You have Coveo for Sitecore on a Sitecore 7.X or 8.0 instance that is indexing the Sitecore items in the "coveomasterindex" CES source. This source is using the "Queue" CES connector.
  2. You have another CES source in a "testcollection" CES collection. This source is using the "Sitecore" CES connector.

What is the utility of that second source?

  1. Is it indexing another Sitecore 6.X instance?
Gravatar for ratnakumar.ravva@accenture.com

Comment by ratnakumar_ravva, Sep 17, 2015 11:04 AM

No, In same Sitecore 8.0 but for specific sitecore path(sitecore/content/website/sample)

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Sep 17, 2015 12:29 PM

You don't need to create separate CES sources for specific Sitecore paths with Coveo for Sitecore. It is recommended to index items only once in the Master and Web sources. Then, use query filters to restrict the results.

To restrict to a particular Sitecore path, get the short GUID of the /sitecore/content/website/sample item (e.g. 110D559FDEA542EA9C1C8A5DF7E70EF9) and do a query filter on the "_path" field like this:

@fz95xpathXXXXX=="110D559FDEA542EA9C1C8A5DF7E70EF9"

This can be done in JavaScript for the Free edition (see Adding Filter and Boost Expressions Programmatically):

Coveo.$('#search').on("buildingQuery", function(e, args) {
    args.queryBuilder.constantExpression.add('<%= ToCoveoFieldName("_path") %> == "110D559FDEA542EA9C1C8A5DF7E70EF9"');
}).coveoForSitecore('init', ...);

A constant expression is used here because the filter is static and will never change. Do not use constant expressions for dynamic filters, use advanced expressions instead.

It can also be done in the "Coveo Search" component properties for the Enterprise edition with the "where the item is the specific item or one of its subitems" filtering rule.

Gravatar for ratnakumar.ravva@accenture.com

Comment by ratnakumar_ravva, Sep 18, 2015 8:05 AM

I'm using Custom Collection for external search. To give more details:

  1. Coveo For Sitecore is used for Sitecore Master and Web index.
  2. Custom Collections are created in Coveo using Siecore2 connector.

We are trying to index a document in custom collection with mutlilist field and want to get values instead of guid.

To solve that problem I created the computed field - I understand that this field will be available for coveo master collection, however trying this to get this field read by custom collection also. If not could you suggest a approach for that.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Sep 18, 2015 9:00 AM

I'm sorry but I still don't understand why you need an external collection and source. Where is that source used for queries? Why can't you use the default web source in that search interface?

By the way, the Sitecore2 connector is not supported by Coveo on Sitecore 8.0. The maximum supported version is Sitecore 7.2.

Ask a question