Syntax
Smartsite SXML | Copy Code |
---|---|
string this.orderby() |
Parameters
Return Value
Data Type | Description |
---|---|
String | The order by clause. |
Used in
Macro | Description |
---|---|
FacetedSearchQueryBuilder | Builds an SQL query for Faceted Search. |
Remarks
The this.orderby() viper can be used to adjust the order of the search results. The viper resolves to the OrderBy parameter as set on the facetedsearchquerybuilder macro, which e.g. can be set to "c.moddate" to order the results by moddate.
When this parameter hasn't been set, the viper will resolve to its specified default:
Smartsite SXML | Copy Code |
---|---|
this.orderby(default="SearchRank DESC") |
Example
Faceted Search Query Xml - MasterQuery Element Example
The Faceted Search Query Builder macro (se:facetedsearchquerybuilder) contains a lot of local instance vipers. Usually, local instance vipers are used within the macro itself, e.g. formatting, but in this case the local instance vipers should only be used within a query xml definition.
This example shows a masterquery element from a query xml definition in which some of the available local instance vipers are used.
Smartsite SXML | Copy Code |
---|---|
<masterquery connection="" defaultsources="content"> <query><![CDATA[ SELECT {this.selectfields()} FROM {this.tableorview()} c JOIN ( SELECT {this.rankingfields()} FROM ( {this.searchquery(default="SELECT Nr, 0 As SearchRank, 1 AS BaseSearch FROM "+this.searchgroupviewname())} ) rq GROUP BY rq.Nr ) vt2 ON c.Nr=vt2.Nr JOIN {this.searchgroupviewname()} sgv WITH (NOEXPAND) ON c.Nr = sgv.Nr {this.joinclause(default="")} {this.resultchanneljoins("c",default="")} WHERE {this.whereclause(default="(1=1)")} AND vt2.BaseSearch = 1 AND {security.getbrowsablewhere('c',100)} ]]> </query> <fields rem="value for this.selectfields(), used to display the query results"><![CDATA[ ROW_NUMBER() OVER (ORDER BY {this.orderby(default="searchrank DESC")}, c.Nr) AS rownum, c.Nr AS Nr, CAST(vt2.searchrank AS INT) AS searchrank, c.contenttype, c.author, c.ModDate AS ModDate, c.Title AS Title, SUBSTRING(sgv.QueryData,0,16000) AS Abstract, ft.FileExtension, {this.resultchannelcode(default="NULL")} AS ChannelCode ]]> </fields> <joins rem="clause used in search results query"><![CDATA[ JOIN FileTypes ft ON c.FileType=ft.Nr ]]> </joins> <rankingfields rem="value for this.rankingfields()"> nr, SUM(searchrank) AS searchrank, COUNT(BaseSearch) AS BaseSearch </rankingfields> <paging rem="paging query for search result"><![CDATA[ SELECT * FROM ( {this.searchquery(default="SELECT Nr, 0 As SearchRank, 1 AS BaseSearch FROM "+this.searchgroupviewname())} ) x WHERE rownum BETWEEN ?:lowerbound AND ?:upperbound ]]> </paging> </masterquery> |
- Macro
- Macro Parameters
- Macro Parameter Properties
-
Vipers
- Global Viper Methods
-
Local Viper Methods
- This.Add (Json) Viper Method
- This.Add (Metadata) Viper Method
- This.Add (PlaceHolder) Viper Method
- This.Add (ShoppingCart) Viper Method
- This.AddDublinCore (Metadata) Viper Method
- This.AddLine Viper Method
- This.AddNamespace (Metadata) Viper Method
- This.AddNull (Json) Viper Method
- This.AddValue (Json) Viper Method
- This.AffectedRecords (SqlQuery) Viper Method
- This.AIM.Relations Viper Method
- This.Allowemptysearch (FacetedSearchQueryBuilder20) Viper Method
- This.AltText (Image) Viper Method
- This.Amount (Payment) Viper Method
- This.Append Viper Method
- This.AppendChild (XmlProcessor) Viper Method
- This.AppendChildBinary (XmlProcessor) Viper Method
- This.AppendChildXml (XmlProcessor) Viper Method
- This.ApplyBoxFormat (SmartletBox) Viper Method
- This.Attribs (SmartletBox) Viper Method
- This.AutoTitle (Image) Viper Method
- This.BoxData (SmartletBox) Viper Method
- This.BoxMode (SmartletBox) Viper Method
- This.BoxSkin (SmartletBox) Viper Method
- This.Brand (Payment) Viper Method
- This.Break (For) Viper Method
- This.Break Viper Method
- This.Buffer.Exists Viper Method
- This.Buffer.Get Viper Method
- This.Buffer.Set Viper Method
- This.Buttons (SmartletBox) Viper Method
- This.CanGoBack (Paging) Viper Method
- This.CanGoForward (Paging) Viper Method
- This.Caption (SmartletBox) Viper Method
- This.ChildLevelResult Viper Method
- This.ClassName (Image) Viper Method
- This.Clear Viper Method
- This.ClearDublinCore (Metadata) Viper Method
- This.ClearForcedResult Viper Method
- This.ColCount Viper Method
- This.ColName Viper Method
- This.ColNumber Viper Method
- This.CompleteDocument Viper Method
- This.ContentTypeWeight (FacetedSearchQueryBuilder) Viper Method
- This.ContentTypeWeight (FacetedSearchQueryBuilder20) Viper Method
- This.Count (Paging) Viper Method
- This.Currency (Payment) Viper Method
- This.Current (Paging) Viper Method
- This.CurrentIndex (Siblings) Viper Method
- This.CustomerAddress (Payment) Viper Method
- This.CustomerCountry (Payment) Viper Method
- This.CustomerEmail (Payment) Viper Method
- This.CustomerName (Payment) Viper Method
- This.CustomerPhone (Payment) Viper Method
- This.CustomerTown (Payment) Viper Method
- This.CustomerZipcode (Payment) Viper Method
- This.Data (ViewSource) Viper Method
- This.Data Viper Method
- This.DefaultResultFormat (XLinks) Viper Method
- This.DefaultRowFormat (XLinks) Viper Method
- This.Delete (XmlProcessor) Viper Method
- This.Delete Viper Method
- This.DocTypeHeader Viper Method
- This.DocumentBody Viper Method
- This.DocumentBodyNode Viper Method
- This.EditedSmartlet (SmartletEditor) Viper Method
- This.EditorUseLocation (SmartletEditor) Viper Method
- This.Enable (CacheFile) Viper Method
- This.Error.InnerException.Message Viper Method
- This.Error.InnerException.SmartsiteCode Viper Method
- This.Error.InnerException.Throw Viper Method
- This.Error.InnerException.ToString Viper Method
- This.Error.InnerException.Type Viper Method
- This.Error.Message Viper Method
- This.Error.SmartsiteCode Viper Method
- This.Error.Throw Viper Method
- This.Error.ToString Viper Method
- This.Error.Type Viper Method
- This.Evaluate (XmlProcessor) Viper Method
- This.Exists (Json) Viper Method
- This.Expires Viper Method
- This.ExtractBinary (XmlProcessor) Viper Method
- This.ExtraData (Payment) Viper Method
- This.ExtraElements (SmartletBox) Viper Method
- This.Facet (FacetedSearchQueryBuilder) Viper Method
- This.Facet (FacetedSearchQueryBuilder20) Viper Method
- This.FacetSelectFields (FacetedSearchQueryBuilder) Viper Method
- This.FacetSelectFields (FacetedSearchQueryBuilder20) Viper Method
- This.FacetWhereClause (FacetedSearchQueryBuilder) Viper Method
- This.FacetWhereClause (FacetedSearchQueryBuilder20) Viper Method
- This.Field Viper Method
- This.Field.Exists Viper Method
- This.FieldName (FacetedSearchQueryBuilder) Viper Method
- This.FieldName (FacetedSearchQueryBuilder20) Viper Method
- This.FieldWeight (FacetedSearchQueryBuilder) Viper Method
- This.FieldWeight (FacetedSearchQueryBuilder20) Viper Method
- This.FindExact Viper Method
- This.FindExtension Viper Method
- This.FirstResult (Paging) Viper Method
- This.Footer (SmartletEditor) Viper Method
- This.ForceLayout (FlexLayout) Viper Method
- This.FormAttribs (SmartletBox) Viper Method
- This.FreetextTablesearch (FacetedSearchQueryBuilder20) Viper Method
- This.Get (Json) Viper Method
- This.GetAttribute (XmlProcessor) Viper Method
- This.GetByPosition (Json) Viper Method
- This.GetCacheKey (Cache) Viper Method
- This.getcount (Chart) Viper Method
- This.GetDocType Viper Method
- This.GetEncoded (Json) Viper Method
- This.GetEncodedValue (Json) Viper Method
- This.GetEncoding Viper Method
- This.GetForcedResult Viper Method
- This.GetInnerXml (XmlProcessor) Viper Method
- This.GetJson (Json) Viper Method
- This.GetJsonTypeName (Json) Viper Method
- This.GetJsonTypeName (Json) Viper Method
- This.GetLabel (SmartletEditor) Viper Method
- This.GetLocalNodeName (XmlProcessor) Viper Method
- This.GetMaxYValue (Chart) Viper Method
- This.GetMinYValue (Chart) Viper Method
- This.GetNameByPosition (Json) Viper Method
- This.GetNamespaceUri (XmlProcessor) Viper Method
- This.GetNodeName (XmlProcessor) Viper Method
- This.GetOmitXmlDeclaration (XHtmlPage) Viper Method
- This.GetParameter Viper Method
- This.GetPollItem (Poll) Viper Method
- This.GetPrefix (XmlProcessor) Viper Method
- This.getseriesname (Chart) Viper Method
- This.GetTotalCount (Paging) Viper Method
- This.GetTypedValue (XmlProcessor) Viper Method
- This.GetValue (Json) Viper Method
- This.GetValue (XmlProcessor) Viper Method
- This.GetValueByPosition (Json) Viper Method
- This.GetXml (XmlProcessor) Viper Method
- This.GoTo (Paging) Viper Method
- This.Group Viper Method
- This.GroupCount Viper Method
- This.GroupNumber Viper Method
- This.GroupResult Viper Method
- This.GroupRowNumber Viper Method
- This.HasUserVoted (Poll) Viper Method
- This.HeadSection Viper Method
- This.Height (SmartletBox) Viper Method
- This.Ignore (CacheFile) Viper Method
- This.ImageId (Image) Viper Method
- This.Index (For) Viper Method
- This.InfoLabel (SmartletEditor) Viper Method
- This.Initialized (Paging) Viper Method
- This.InnerClass (SmartletBox) Viper Method
- This.InsertAfter (XmlProcessor) Viper Method
- This.InsertBefore (XmlProcessor) Viper Method
- This.InsertNodeAfter (XmlProcessor) Viper Method
- This.InsertNodeBefore (XmlProcessor) Viper Method
- This.isActive (Poll) Viper Method
- This.IsBaseQuery (FacetedSearchQueryBuilder) Viper Method
- This.IsBaseQuery (FacetedSearchQueryBuilder20) Viper Method
- This.IsCached (Cache) Viper Method
- This.IsDirectory (Dir) Viper Method
- This.isMultiSelect (Poll) Viper Method
- This.ItemFormat (FeedReader) Viper Method
- This.ItemFormat (SiteMap) Viper Method
- This.JoinClause (FacetedSearchQueryBuilder) Viper Method
- This.JoinClause (FacetedSearchQueryBuilder20) Viper Method
- This.Key.Add (CacheFile) Viper Method
- This.Key.RemoveChannelDependency (CacheFile) Viper Method
- This.LastModified Viper Method
- This.LastResult (Paging) Viper Method
- This.Length (Json) Viper Method
- This.Length Viper Method
- This.Level Viper Method
- This.LevelResult Viper Method
- This.LevelRowNumber Viper Method
- This.Load (Json) Viper Method
- This.Location (Paging) Viper Method
- This.Location Viper Method
- This.MaxRows Viper Method
- This.MimeType (Json) Viper Method
- This.MimeType Viper Method
- This.Mode (FacetedSearchQueryBuilder) Viper Method
- This.Mode (FacetedSearchQueryBuilder20) Viper Method
- This.Name Viper Method
- This.Offset (Paging) Viper Method
- This.OnClick (Image) Viper Method
- This.OrderBy (FacetedSearchQueryBuilder20) Viper Method
- This.OrderId (Payment) Viper Method
- This.OuterClass (SmartletBox) Viper Method
- This.OuterId (SmartletBox) Viper Method
- This.OutputColorDepth (Image) Viper Method
- This.OutputCommandOrder (Image) Viper Method
- This.OutputFileSize (Image) Viper Method
- This.OutputFileType (Image) Viper Method
- This.OutputFrameCount (Image) Viper Method
- This.OutputHeight (Image) Viper Method
- This.OutputLocation (Image) Viper Method
- This.OutputResolutionUnit (Image) Viper Method
- This.OutputResolutionX (Image) Viper Method
- This.OutputResolutionY (Image) Viper Method
- This.OutputStyle (Image) Viper Method
- This.OutputWidth (Image) Viper Method
- This.param Viper Method
- This.ParameterExists Viper Method
- This.ParentLevel (Parents) Viper Method
- This.PaymentMethod (Payment) Viper Method
- This.PopularityWeight (FacetedSearchQueryBuilder) Viper Method
- This.PopularityWeight (FacetedSearchQueryBuilder20) Viper Method
- This.PopulateDatatable (XmlProcessor) Viper Method
- This.PreviewPane (SmartletEditor) Viper Method
- This.Price (ShoppingCart) Viper Method
- This.Products (ShoppingCart) Viper Method
- This.Question (Poll) Viper Method
- This.Rank (Tags) Viper Method
- This.RankingFields (FacetedSearchQueryBuilder) Viper Method
- This.RankingFields (FacetedSearchQueryBuilder20) Viper Method
- This.RankingStatement (FacetedSearchQueryBuilder) Viper Method
- This.RankingStatement (FacetedSearchQueryBuilder20) Viper Method
- This.RawField Viper Method
- This.Redirect (Payment) Viper Method
- This.Remove (Json) Viper Method
- This.Remove (ShoppingCart) Viper Method
- This.RemoveAll (ShoppingCart) Viper Method
- This.RemoveAttribute (XmlProcessor) Viper Method
- This.RemoveNamespace (XmlProcessor) Viper Method
- This.Render (Application) Viper Method
- This.Render Viper Method
- This.Rendered Viper Method
- This.RenderedChannel (References) Viper Method
- This.RenderTime Viper Method
- This.ResponseCookies (EmbedUri) Viper Method
- This.ResponseHeaders (EmbedUri) Viper Method
- This.ResponseHeaders Viper Method
- This.ResponseTime Viper Method
- This.Result Viper Method
- This.Result Viper Method
- This.ResultChannelCode (FacetedSearchQueryBuilder) Viper Method
- This.ResultChannelCode (FacetedSearchQueryBuilder20) Viper Method
- This.ResultChannelJoins (FacetedSearchQueryBuilder) Viper Method
- This.ResultChannelJoins (FacetedSearchQueryBuilder20) Viper Method
- This.RowCount Viper Method
- This.RowNumber Viper Method
- This.RowResult Viper Method
- This.Search Viper Method
- This.SearchCondition (FacetedSearchQueryBuilder) Viper Method
- This.SearchCondition (FacetedSearchQueryBuilder20) Viper Method
- This.SearchGroupViewName (FacetedSearchQueryBuilder) Viper Method
- This.SearchGroupViewName (FacetedSearchQueryBuilder20) Viper Method
- This.SearchQuery (FacetedSearchQueryBuilder) Viper Method
- This.SearchQuery (FacetedSearchQueryBuilder20) Viper Method
- This.SelectFields (FacetedSearchQueryBuilder) Viper Method
- This.SelectFields (FacetedSearchQueryBuilder20) Viper Method
- This.SeoPriority (FacetedSearchQueryBuilder) Viper Method
- This.SeoPriority (FacetedSearchQueryBuilder20) Viper Method
- This.Serial (Payment) Viper Method
- This.Serve (CacheFile) Viper Method
- This.Set (Json) Viper Method
- This.SetAttribute (XmlProcessor) Viper Method
- This.SetCurrentPage (Paging) Viper Method
- This.SetCustomDocType Viper Method
- This.SetDocType Viper Method
- This.SetEncoding Viper Method
- This.SetForcedResult Viper Method
- This.SetInnerXml (XmlProcessor) Viper Method
- This.SetNamespace (XmlProcessor) Viper Method
- This.SetNull (Json) Viper Method
- This.SetOmitXmlDeclaration (XHtmlPage) Viper Method
- This.SetProductCount (ShoppingCart) Viper Method
- This.SetResult (XmlProcessor) Viper Method
- This.SetTotalCount (Paging) Viper Method
- This.SetValue (Json) Viper Method
- This.SetValue (XmlProcessor) Viper Method
- This.SetXmlVersion (XHtmlPage) Viper Method
- This.SiblingCount (Siblings) Viper Method
- This.SiblingExists (Siblings) Viper Method
- This.Size (Dir) Viper Method
- This.Size (Paging) Viper Method
- This.Size Viper Method
- This.Skip (Paging) Viper Method
- This.SkipRows Viper Method
- This.SmartletName (SmartletEditor) Viper Method
- This.Status (Payment) Viper Method
- This.StatusCode Viper Method
- This.Step (For) Viper Method
- This.Summary (Payment) Viper Method
- This.SXMLPath Viper Method
- This.TableOrView (FacetedSearchQueryBuilder) Viper Method
- This.TableOrView (FacetedSearchQueryBuilder20) Viper Method
- This.TaxGroups (ShoppingCart) Viper Method
- This.TaxTotals (ShoppingCart) Viper Method
- This.Title (Dir) Viper Method
- This.Title (Image) Viper Method
- This.Title (SmartletEditor) Viper Method
- This.Title Viper Method
- This.ToDisplay (ShoppingCart) Viper Method
- This.ToString (ShoppingCart) Viper Method
- This.Totals (ShoppingCart) Viper Method
- This.TotalVotes (Poll) Viper Method
- This.ToXml (ShoppingCart) Viper Method
- This.UseBox (SmartletBox) Viper Method
- This.Value (Switch) Viper Method
- This.VisibleRowCount Viper Method
- This.VisibleRowNumber Viper Method
- This.Vote (Poll) Viper Method
- This.WhereClause (FacetedSearchQueryBuilder) Viper Method
- This.WhereClause (FacetedSearchQueryBuilder20) Viper Method
- This.Width (SmartletBox) Viper Method
- This.Xml (XmlProcessor) Viper Method
- This.XmlDeclaration (XHtmlPage) Viper Method
- This.XValue (Chart) Viper Method
- This.YValue (Chart) Viper Method
- SXML Data Types
- Examples
- Tips & Tricks