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
CountPreCalculate
public bool CountPreCalculate { get; }
Property Value
Created
Gets or sets the created date of the smart search.
public DateTime Created { get; set; }
Property Value
DataProviderTypeName
Gets the name of the data provider type name.
public string DataProviderTypeName { get; }
Property Value
DataProviderXmlParams
Gets or sets the params of data provider.
public string DataProviderXmlParams { get; set; }
Property Value
ID
Gets or sets the unique ID of the smart search.
public Guid ID { get; set; }
Property Value
Index
Get or sets a string containing the information about the index.
public string Index { get; set; }
Property Value
IsHidden
Gets or sets visibility on the base smart search list.
public bool IsHidden { get; set; }
Property Value
IsResultsLimit
Returns is results has limitations
public bool IsResultsLimit { get; }
Property Value
Name
Gets or sets the name of the smart search.
public string Name { get; set; }
Property Value
PrimarySort
Gets or sets the primary sort results information.
public SmartSearchSortInfo PrimarySort { get; set; }
Property Value
ResultsLimit
Results limit count
public int ResultsLimit { get; set; }
Property Value
RuleGroups
Gets or sets the rules groups
public SmartSearchRuleGroupCollection RuleGroups { get; set; }
Property Value
RulesGroups
Gets or sets the rules groups
[Obsolete("Use RuleGroups instead")]
public SmartSearchRulesGroupCollection RulesGroups { get; set; }
Property Value
SecondarySort
Gets or sets the secondary sort results information.
public SmartSearchSortInfo SecondarySort { get; set; }
Property Value
UserID
Gets or sets the user id.
public int UserID { get; set; }
Property Value
ViewFields
Gets Or sets view fields
public IEnumerable<ViewField> ViewFields { get; set; }
Property Value
ViewLanguages
Gets Or sets view languages
public IEnumerable<Language> ViewLanguages { get; set; }
Property Value
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
DeserializeViewFields(XmlNode)
Deserializes the sort info.
protected bool DeserializeViewFields(XmlNode DataNode)
Parameters
DataNode
XmlNode- The data node.
Returns
DeserializeViewLanguages(XmlNode)
Deserializes the sort info.
protected bool DeserializeViewLanguages(XmlNode DataNode)
Parameters
DataNode
XmlNode- The data node.
Returns
GetAllSmartSearches(bool, int)
Gets all smart searches.
public static SmartSearchCollection GetAllSmartSearches(bool Hidden = false, int UserID = -1)
Parameters
Returns
GetCount()
Execute smart search filter and get count
public int GetCount()
Returns
GetPreviewDescriptionText()
Gets the preview description text.
public string GetPreviewDescriptionText()
Returns
GetPreviewResult()
Gets the preview result.
public DataTable GetPreviewResult()
Returns
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
Load(Guid)
Loads data from the current ID row.
public bool Load(Guid id)
Parameters
id
Guid- ID of the current row.
Returns
Save()
Saves current data to the smart search file.
public bool Save()
Returns
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
Serialize()
Serializes smart search instance.
public XmlDocument Serialize()
Returns
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.