Gravatar for nagasekhar.k@itcinfotech.com

Question by nagasekhar, Dec 16, 2014 5:07 AM

Coveo Query for Sitecore

Hi ,

I am querying some items in Coveo.But im getting result as order by updated(order by item latest updated).But i need no change order when i am querying.How can i do in Coveo query. ex:-below query returning always latest updated items first.But i need as it is even i updated any item.please help me abc= LinqHelper.CreateQuery(searchContext, DataSourceSearchStringModels) .Where(result => result.TemplateId == templateId && result.Language.ExactMatch(contextLanguage)) .OrderBy(result => result["__sortorder"])

                    .Select(result => result.GetItem()).Take(1000)
                    .ToClass<T>();
1 Reply
Gravatar for vseguin@coveo.com

Answer by Vincent Séguin, Dec 16, 2014 7:36 AM

Hello,

I'm not sure to entirely understand your question… On which field do you want to sort? In any case, when you want to sort on a field, make sure the field is declared as 'isSortable' in the fieldMap of Coveo.SearchProvider.config.

You can learn more about it on this page : https://developers.coveo.com/display/SC201412/Understanding+the+Coveo+Search+Provider's+Configuration+File -> fieldMap section.

Ask a question