Reference Classes and Attributes

Outer <div>

Classes

sift

Required to identify this <div> to Sift.

sift-update-on-change

Results will be updated when one of the criteria values is changed. For text fields this will be when the field loses focus, unless a data-sift-min-change-letters attribute is specified.

sift-auto-load-on-page-load

Results will be automatically loaded after the page refreshes.

Attributes

data-sift-result-document-type
Mandatory

Document type alias. The search results will contain only content that uses the specified document type. Can be a comma-separated list for multiple document types (sharing the same field names).

data-sift-result-root
Default: all content

Id (integer) or Guid of the root element for the search. Only content below the given root in the tree will be returned.

data-sift-result-partial
Default: _SiftDefaultResults

Name of a partial view (without the .cshtml extension). This partial view will be used to construct the results that are displayed in the sift-result div.

data-sift-culture
Default: Default language for site

Culture string. Any content retrieved (both in the results and in the criteria) will be for the specified culture. For example, "en-us" or "it".

data-sift-result-sort-by
Default: Search score

Comma-separated list of property aliases (or "nodeName"), each optionally followed by space and either "asc" or "desc". The results will be sorted by these properties.

data-sift-max-results
Default: 500

The maximum number of results to retrieve. If set to 0, then the default will be used. If pagination is used, then only the pages up to this maximum will be shown.

data-sift-results-per-page
Default: 0

The number of results to show on each page. If set to 0, then no pagination is applied and all results will be displayed on page 1.

data-sift-remember-criteria
Default: none

Can be set to "session", "local" or "none". The values selected will be recorded in session storage or local storage on the browser. Session storage will only be for the current tab and will be lost when it is closed. Local storage is permanent, and will be remembered even if the tab/browser is closed.

data-sift-start-search
Default: empty

Expression will be evaluated when a search is begun. Designed to be used to call a function that will display an overlay while the search takes place. Must return true for the search to continue. Search will not take place if it returns false (or nothing).

data-sift-end-search
Default: empty

Expression will be evaluated when a search has finished. Designed to be used to call a function that will hide an overlay when the search has finished.

data-sift-searcher
Default: Default searcher based on Examine

If a named searcher is provided, then a class implementing the ISearchService interface must have been added to Sift using the SearchServiceFactory.

Criteria

Classes

sift-criterion

Identifies the element as a Sift criterion.

sift-wildcard

For INPUT of type text. Search will be conducted using a wildcard search with the words searched for individually.

sift-multi-all-selected

For SELECT with multiple attribute or containing div of a checkbox group. Matching content will need to have all of the options selected (default is any one of them).

sift-checkboxes

The criterion must be a DIV or UL, in which the checkbox group will be created.

sift-radio-buttons

The criterion must be a DIV or UL, in which the radio button group will be created.

sift-populated

This class will stop the automatic population of the options list (select dropdown, checkboxes or radio buttons). The options must be provided in the page.

Attributes

data-sift-match-property
Mandatory

Property alias. Specifies which property this criterion will be matched against in the search result content nodes.

data-sift-criterion-display-property
Default: nodeName

For use when there is an options list for the criterion. Property that will be displayed in the options list.

data-sift-criterion-sort-by

For use when there is an options list for the criterion. Comma-separated list of property aliases (or "nodeName"), each optionally followed by space and either "asc" or "desc". The criterion options list will be sorted by this property.

data-sift-default-option

For use when an option list has been created (SELECT (not multiple), radio buttons). Text for the option that will not restrict the search.

data-sift-label-placement

The placement of the label for checkboxes and radio buttons. Can be set to "before", "after" or "none". If not set, or set to another value, then label will be after the checkbox/radio button.

data-sift-min-change-letters

If the outer <div> has specified that the results should be updated on change, then this attribute will cause the results to be updated each time a key is pressed on this field. They will only be updated if the number of letters in the field is greater to or equal to the value specified in this attribute.

data-sift-key-press-delay

If the outer <div> has specified that the results should be updated on change and a minimum number of letters has been specified then a delay will be introduced after which the results will be updated. This reduces the number of searches done when the user quickly types a phrase. By default this delay is 500 milliseconds, but can be updated using this attribute. Value should be in milliseconds.

data-sift-comparison-operator

For use with date, datetime and number criteria. Can be set to EQ, GE, GT, LE or LT. The matching field in Umbraco will need to be equal to, greater or equal to, greater than, less than or equal to, less than the field entered by the user.

data-sift-date-part

Determines which part of the date is compared with the value given: date (default), datetime, dayofweek, dayofmonth, month, year.

data-sift-date-format

.NET standard or custom date/time format. If not provided, then the current culture-specific format will be expected.

https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings

https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings

Search Button

Classes

sift-criteria

Identifies that this element (which can be any clickable element) will trigger a search when clicked.

Attributes

data-sift-results-page-number
Default: 0

The page number to display, starting at page 0.

Web.config

App Settings

The following keys can be added to the <AppSettings> section of the Web.config file. Each can have its value set to a comma-separated list of property aliases.

Sift.DateIndexFields

Property will be treated as a DateTime and can be used in criteria with a comparison operator.

Sift.IntegerIndexFields

Property will be treated as an int and can be used in criteria with a comparison operator.

Sift.DecimalIndexFields

Property will be treated as a decimal and can be used in criteria with a comparison operator.

Sift.SortableTextFields

Required for properties that are text that may be used in sorting. The sort will not work if the property has not been added to this list.

 

<< Back to User Guide