Table of Contents

Class SmartSearch

Namespace
Dynamicweb.SmartSearch
Assembly
Dynamicweb.SmartSearch.dll
Represents smart search definition
public class SmartSearch
Inheritance
SmartSearch
Inherited Members

Constructors

SmartSearch(string)

Initializes a new instance of an object.
public SmartSearch(string dataProviderTypeName = "")

Parameters

dataProviderTypeName string

Properties

Configuration

Gets or sets the path to the configuration file.
public string Configuration { get; set; }

Property Value

string

CountPreCalculate

public bool CountPreCalculate { get; }

Property Value

bool

Created

Gets or sets the created date of the smart search.
public DateTime Created { get; set; }

Property Value

DateTime

DataProviderTypeName

Gets the name of the data provider type name.
public string DataProviderTypeName { get; }

Property Value

string

DataProviderXmlParams

Gets or sets the params of data provider.
public string DataProviderXmlParams { get; set; }

Property Value

string

ID

Gets or sets the unique ID of the smart search.
public Guid ID { get; set; }

Property Value

Guid

Index

Get or sets a string containing the information about the index.
public string Index { get; set; }

Property Value

string

IsHidden

Gets or sets visibility on the base smart search list.
public bool IsHidden { get; set; }

Property Value

bool

IsResultsLimit

Returns is results has limitations
public bool IsResultsLimit { get; }

Property Value

bool

Name

Gets or sets the name of the smart search.
public string Name { get; set; }

Property Value

string

PrimarySort

Gets or sets the primary sort results information.
public SmartSearchSortInfo PrimarySort { get; set; }

Property Value

SmartSearchSortInfo

ResultsLimit

Results limit count
public int ResultsLimit { get; set; }

Property Value

int

RuleGroups

Gets or sets the rules groups
public SmartSearchRuleGroupCollection RuleGroups { get; set; }

Property Value

SmartSearchRuleGroupCollection

RulesGroups

Gets or sets the rules groups
[Obsolete("Use RuleGroups instead")]
public SmartSearchRulesGroupCollection RulesGroups { get; set; }

Property Value

SmartSearchRulesGroupCollection

SecondarySort

Gets or sets the secondary sort results information.
public SmartSearchSortInfo SecondarySort { get; set; }

Property Value

SmartSearchSortInfo

UserID

Gets or sets the user id.
public int UserID { get; set; }

Property Value

int

ViewFields

Gets Or sets view fields
public IEnumerable<ViewField> ViewFields { get; set; }

Property Value

IEnumerable<ViewField>

ViewLanguages

Gets Or sets view languages
public IEnumerable<Language> ViewLanguages { get; set; }

Property Value

IEnumerable<Language>

Methods

Delete()

Deletes the current object.
public void Delete()

Deserialize(XmlDocument)

Reads the object data from the given XML document and applies the information to the current instance.
public bool Deserialize(XmlDocument document)

Parameters

document XmlDocument
XML document containing an information about the object.

Returns

bool
Value indicating whether information has been successfully retrieved from the XML document.

DeserializeSortInfo(XmlNode)

Deserializes the sort info.
protected bool DeserializeSortInfo(XmlNode DataNode)

Parameters

DataNode XmlNode
The data node.

Returns

bool

DeserializeViewFields(XmlNode)

Deserializes the sort info.
protected bool DeserializeViewFields(XmlNode DataNode)

Parameters

DataNode XmlNode
The data node.

Returns

bool

DeserializeViewLanguages(XmlNode)

Deserializes the sort info.
protected bool DeserializeViewLanguages(XmlNode DataNode)

Parameters

DataNode XmlNode
The data node.

Returns

bool

GetAllSmartSearches(bool, int)

Gets all smart searches.
public static SmartSearchCollection GetAllSmartSearches(bool Hidden = false, int UserID = -1)

Parameters

Hidden bool
if set to true get hidden smart searches.
UserID int
The user ID.

Returns

SmartSearchCollection

GetCount()

Execute smart search filter and get count
public int GetCount()

Returns

int

GetPreviewDescriptionText()

Gets the preview description text.
public string GetPreviewDescriptionText()

Returns

string

GetPreviewResult()

Gets the preview result.
public DataTable GetPreviewResult()

Returns

DataTable

GetResult<T>()

Execute smart search and gets the result.
public T GetResult<T>() where T : class

Returns

T

Type Parameters

T

GetResult<T>(params SmartSearchSortInfo[])

public T GetResult<T>(params SmartSearchSortInfo[] SortParams) where T : class

Parameters

SortParams SmartSearchSortInfo[]

Returns

T

Type Parameters

T

GetSmartSearchesByDataProvider(string, bool, int)

Gets the smart searches by data provider.
public static SmartSearchCollection GetSmartSearchesByDataProvider(string DataProviderName, bool Hidden = false, int UserID = -1)

Parameters

DataProviderName string
Name of the data provider.
Hidden bool
if set to true get hidden smart searches.
UserID int
The user ID.

Returns

SmartSearchCollection

Load(Guid)

Loads data from the current ID row.
public bool Load(Guid id)

Parameters

id Guid
ID of the current row.

Returns

bool

Save()

Saves current data to the smart search file.
public bool Save()

Returns

bool

Remarks

Return false if file with this name exist

Save(string)

Saves current data to the smart search file.
public bool Save(string path)

Parameters

path string
The path where the smart search file should be saved relative to the Smart search folder

Returns

bool

Serialize()

Serializes smart search instance.
public XmlDocument Serialize()

Returns

XmlDocument

SerializeSortInfo(ref XmlElement, ref XmlDocument, params SmartSearchSortInfo[])

Serializes the sort info.
protected void SerializeSortInfo(ref XmlElement appendTo, ref XmlDocument doc, params SmartSearchSortInfo[] SortParams)

Parameters

appendTo XmlElement
The append to.
doc XmlDocument
The doc.
SortParams SmartSearchSortInfo[]
The sort params.

SerializeViewFields(ref XmlElement, ref XmlDocument, ref IEnumerable<ViewField>)

Serializes the view fields.
protected void SerializeViewFields(ref XmlElement appendTo, ref XmlDocument doc, ref IEnumerable<ViewField> ViewFields)

Parameters

appendTo XmlElement
The append to.
doc XmlDocument
The doc.
ViewFields IEnumerable<ViewField>
The view fields.

SerializeViewLanguages(ref XmlElement, ref XmlDocument, ref IEnumerable<Language>)

Serializes the view fields.
protected void SerializeViewLanguages(ref XmlElement appendTo, ref XmlDocument doc, ref IEnumerable<Language> ViewLanguages)

Parameters

appendTo XmlElement
The append to.
doc XmlDocument
The doc.
ViewLanguages IEnumerable<Language>
The view languages.
To top