Gravatar for fcote@coveo.com

Question by fcote, May 7, 2015 10:44 AM

Using SearchStringModel instead of UIFilterHelpers in Sitecore 7.5

I'm in the process of upgrading from Sitecore 7.1 to 7.5. I just realized that :

The UIFilterHelpers method is from namespace Sitecore.Buckets.Util in Sitecore 7.1, But, in Sitecore 7.5, the same method not found in namespace Sitecore.Buckets.Util. The SearchStringModel is part of namespace Sitecore.ContentSearch.Utilities. The DataSource is from namespace BaseSubLayout.DataSource.

So what I did was to use SearchStringModel instead of UIFilterHelpers (Check code snippet bellow)

Therefore, my question is does my modification will hold once it's applied in Coveo for Sitecore

I didnt find more documentation on this anywhere. Can you please clarify that this code holds good.

Code snippet in Sitecore 7.1:

private IEnumerable<SearchStringModel> _dataSourceSearchStringModels; 

/// <summary> 
/// The seach string models parsed from the rendering data source 
/// </summary> 
public IEnumerable<SearchStringModel> DataSourceSearchStringModels 
{ 
    get 
    { 
        if (_dataSourceSearchStringModels == null && !string.IsNullOrEmpty(DataSource)) { 
            _dataSourceSearchStringModels = UIFilterHelpers.ParseDatasourceString(DataSource); 
        } 
        return _dataSourceSearchStringModels; 
    } 
} 

Code snippet in Sitecore 7.5: This is working fine.

private IEnumerable<SearchStringModel> _dataSourceSearchStringModels; 

/// <summary> 
/// The seach string models parsed from the rendering data source 
/// </summary> 
public IEnumerable<SearchStringModel> DataSourceSearchStringModels 
{ 
    get 
    { 
        if (_dataSourceSearchStringModels == null && !string.IsNullOrEmpty(DataSource)) { 
            _dataSourceSearchStringModels = SearchStringModel.ParseDatasourceString(DataSource); 
        } 
        return _dataSourceSearchStringModels; 
    } 
} 
1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, May 11, 2015 2:44 AM

I'm not sure of the relation between your code/modification and Coveo for Sitecore.

Coveo for Sitecore neither use the UIFilterHelpers and SearchStringModel classes nor the DataSourceSearchStringModels property.

So I doubt that your change will have any effect on Coveo for Sitecore.

Note that when upgrading from Sitecore 7.1 to Sitecore 7.5, you must also install the Sitecore 7.5 version of Coveo for Sitecore. It includes assemblies specifically built to work with the Sitecore 7.5 APIs. If you keep your Coveo for Sitecore for Sitecore 7.1 package, you will have exceptions and problems here and there.

Ask a question