Class SearchFilterHelper

Inheritance
System.Object
SearchFilterHelper
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Website.Search
Assembly: Mediachase.Commerce.Website.dll
Version: 10.8.0
Syntax
public class SearchFilterHelper

Constructors

SearchFilterHelper()

Initializes a new instance of the SearchFilterHelper class.

Declaration
public SearchFilterHelper()

Properties

Current

Gets the current.

Declaration
public static SearchFilterHelper Current { get; }
Property Value
Type Description
SearchFilterHelper

The current.

QueryString

The query string used for fetching search requests.

Declaration
public NameValueCollection QueryString { get; set; }
Property Value
Type Description
System.Collections.Specialized.NameValueCollection
Remarks

This will typically be the default value of HttpContext.Current.Request.QueryString. However, if calling code needs to modify the collection, this can be used to inject a modifiable clone.

Results

Gets the results.

Declaration
public ISearchResults Results { get; }
Property Value
Type Description
ISearchResults

The results.

SearchConfig

Gets the search config.

Declaration
public SearchConfig SearchConfig { get; }
Property Value
Type Description
SearchConfig

The search config.

SearchConfigPath

Gets or sets the search config path.

Declaration
public string SearchConfigPath { get; set; }
Property Value
Type Description
System.String

The search config path.

SelectedFilters

Gets the selected filters.

Declaration
public virtual SelectedFilter[] SelectedFilters { get; }
Property Value
Type Description
SelectedFilter[]

The selected filters.

Methods

CreateSearchCriteria(String, SearchSort)

Creates the search criteria.

Declaration
public virtual CatalogEntrySearchCriteria CreateSearchCriteria(string keywords, SearchSort sort)
Parameters
Type Name Description
System.String keywords

The keywords.

SearchSort sort

The sort.

Returns
Type Description
CatalogEntrySearchCriteria

GetCleanUrl()

Gets the clean URL without filters.

Declaration
public string GetCleanUrl()
Returns
Type Description
System.String

GetFacets(Boolean, TimeSpan)

Gets the facets.

Declaration
public virtual ISearchFacetGroup[] GetFacets(bool cacheResults, TimeSpan cacheTimeout)
Parameters
Type Name Description
System.Boolean cacheResults

if set to true [cache results].

System.TimeSpan cacheTimeout

The cache timeout.

Returns
Type Description
ISearchFacetGroup[]

GetOutlinesForNode(CatalogNode)

Gets the outlines for node.

Declaration
public static StringCollection GetOutlinesForNode(CatalogNode node)
Parameters
Type Name Description
CatalogNode node

The node.

Returns
Type Description
System.Collections.Specialized.StringCollection

GetOutlinesForNode(String)

Gets the outlines for node.

Declaration
public static StringCollection GetOutlinesForNode(string nodeCode)
Parameters
Type Name Description
System.String nodeCode

The node code.

Returns
Type Description
System.Collections.Specialized.StringCollection

GetQueryStringNavigateUrl(String, Boolean)

Gets the query string navigate URL.

Declaration
public static string GetQueryStringNavigateUrl(string field, bool remove)
Parameters
Type Name Description
System.String field

The field.

System.Boolean remove

if set to true [remove].

Returns
Type Description
System.String

GetQueryStringNavigateUrl(String, String)

Gets the query string navigate URL.

Declaration
public static string GetQueryStringNavigateUrl(string field, string key)
Parameters
Type Name Description
System.String field

The field.

System.String key

The key.

Returns
Type Description
System.String

GetQueryStringNavigateUrl(String, String, Boolean)

Gets the query string navigate URL.

Declaration
public static string GetQueryStringNavigateUrl(string field, string key, bool remove)
Parameters
Type Name Description
System.String field

The field.

System.String key

The key.

System.Boolean remove

if set to true [remove].

Returns
Type Description
System.String

GetQueryStringNavigateUrl(String, String, String, Boolean)

Gets the query string navigate URL.

Declaration
public static string GetQueryStringNavigateUrl(string url, string field, string key, bool remove)
Parameters
Type Name Description
System.String url

The URL.

System.String field

The field.

System.String key

The key.

System.Boolean remove

if set to true [remove].

Returns
Type Description
System.String

GetSuggestions()

Gets the suggestion keywords related to the current search.

Declaration
public virtual string[] GetSuggestions()
Returns
Type Description
System.String[]

GetSuggestions(String)

Gets the suggestion keywords related to the search keyword passed.

Declaration
public virtual string[] GetSuggestions(string keyword)
Parameters
Type Name Description
System.String keyword

The keyword.

Returns
Type Description
System.String[]

SearchEntries()

Searches the entries.

Declaration
public virtual ISearchResults SearchEntries()
Returns
Type Description
ISearchResults

SearchEntries(CatalogEntrySearchCriteria)

Searches the entries.

Declaration
public virtual ISearchResults SearchEntries(CatalogEntrySearchCriteria criteria)
Parameters
Type Name Description
CatalogEntrySearchCriteria criteria

The criteria.

Returns
Type Description
ISearchResults

SearchEntries(CatalogEntrySearchCriteria, Boolean, Single)

Declaration
public virtual ISearchResults SearchEntries(CatalogEntrySearchCriteria criteria, bool isFuzzySearch, float minSimilarity)
Parameters
Type Name Description
CatalogEntrySearchCriteria criteria
System.Boolean isFuzzySearch
System.Single minSimilarity
Returns
Type Description
ISearchResults

SearchEntries(CatalogEntrySearchCriteria, out Int32, CatalogEntryResponseGroup, Boolean, TimeSpan)

Searches the entries.

Declaration
public virtual Entries SearchEntries(CatalogEntrySearchCriteria criteria, out int count, CatalogEntryResponseGroup responseGroup, bool cacheResults, TimeSpan cacheTimeout)
Parameters
Type Name Description
CatalogEntrySearchCriteria criteria

The criteria.

System.Int32 count

The count.

CatalogEntryResponseGroup responseGroup

The response group.

System.Boolean cacheResults

If set to true then fetch through cache, otherwise fetch fresh from db.

System.TimeSpan cacheTimeout

The cache timeout.

Returns
Type Description
Entries

The search result.

SearchEntries(CatalogEntrySearchCriteria, out Int32, CatalogEntryResponseGroup, Boolean, TimeSpan, IMarket)

Searches the entries.

Declaration
[Obsolete("Set the MarketId at criteria.MarketId, and use the SearchEntries method without a market parameter. The criteria.MarketId property and the market parameter are redundant. Will remain at least until November 2016.", true)]
public virtual Entries SearchEntries(CatalogEntrySearchCriteria criteria, out int count, CatalogEntryResponseGroup responseGroup, bool cacheResults, TimeSpan cacheTimeout, IMarket market)
Parameters
Type Name Description
CatalogEntrySearchCriteria criteria

The criteria.

System.Int32 count

The count.

CatalogEntryResponseGroup responseGroup

The response group.

System.Boolean cacheResults

If set to true then fetch through cache, otherwise fetch fresh from db.

System.TimeSpan cacheTimeout

The cache timeout.

IMarket market

Market for filtering.

Returns
Type Description
Entries

The search result.

SearchEntries(String, SearchSort)

Searches the entries.

Declaration
public virtual ISearchResults SearchEntries(string keywords, SearchSort sort)
Parameters
Type Name Description
System.String keywords

The keywords.

SearchSort sort

The sort.

Returns
Type Description
ISearchResults

SearchEntries(String, SearchSort, Int32, Int32, out Int32, CatalogEntryResponseGroup, Boolean, TimeSpan)

Searches the entries.

Declaration
public virtual Entries SearchEntries(string keywords, SearchSort sort, int startIndex, int recordsToRetrieve, out int count, CatalogEntryResponseGroup responseGroup, bool cacheResults, TimeSpan cacheTimeout)
Parameters
Type Name Description
System.String keywords

The keywords.

SearchSort sort

The sort.

System.Int32 startIndex

The start index.

System.Int32 recordsToRetrieve

The records to retrieve.

System.Int32 count

The count.

CatalogEntryResponseGroup responseGroup

The response group.

System.Boolean cacheResults

If set to true then fetch through cache, otherwise fetch fresh from db.

System.TimeSpan cacheTimeout

The cache timeout.

Returns
Type Description
Entries