• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class SearchQuery

Criteria to search for.

Inheritance
System.Object
SearchQuery
Namespace: DotNetNuke.Services.Search.Entities
Assembly: DotNetNuke.dll
Syntax
public class SearchQuery : object
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

Constructors

| Improve this Doc View Source

SearchQuery()

Initializes a new instance of the SearchQuery class.

Declaration
public SearchQuery()
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

Properties

| Improve this Doc View Source

AllowLeadingWildcard

Gets or sets a value indicating whether set this to true to allow search in word.

Declaration
public bool AllowLeadingWildcard { get; set; }
Property Value
Type Description
System.Boolean
Remarks

When host setting "Search_AllowLeadingWildcard" set to true, it will always allow search in word but ignore this value.

| Improve this Doc View Source

BeginModifiedTimeUtc

Gets or sets begin Date of the time when Content was last modified (in Utc). This field is optional.

Declaration
public DateTime BeginModifiedTimeUtc { get; set; }
Property Value
Type Description
DateTime
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

BodySnippetLength

Gets or sets maximum length of highlighted title field in the results.

Declaration
public int BodySnippetLength { get; set; }
Property Value
Type Description
System.Int32
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

CultureCode

Gets or sets culture Code associated with the content.

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

Culture-Neutral content is always returned even though this value is specfied.

| Improve this Doc View Source

CustomKeywords

Gets or sets restrict search to specific Keywords. This field is optional. Lookup is done in the SearchDocument.Keywords collection.

Declaration
public IDictionary<string, string> CustomKeywords { get; set; }
Property Value
Type Description
IDictionary<System.String, System.String>
Remarks

This is key-value pair, e.g. "AliasName","something".

| Improve this Doc View Source

CustomSortField

Gets or sets name of the custom sort field, works with SortFields.CustomNumericField or SortFields.CustomStringField option.

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

Enum SortFields can be used to sort on Relevance, LastModified and Title. Additional fields such as one provided under SearchDocument.Keywords, SearchDocument.NumericKeys or Tags can be specified. can be specified by using CustomSortField property. One needs to ensure that the field name is a valid one.

Examples

authorid or authorname.

| Improve this Doc View Source

EndModifiedTimeUtc

Gets or sets end Date of the time when Content was last modified (in Utc). This field is optional.

Declaration
public DateTime EndModifiedTimeUtc { get; set; }
Property Value
Type Description
DateTime
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

KeyWords

Gets or sets keywords to search for.

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

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

Locale

Gets or sets locale to restrict Search to. This field can be left empty for single language site.

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

E.g. A value en-US or nl-NL can specified to restrict search to a single locale .

| Improve this Doc View Source

ModuleDefIds

Gets or sets a collection of Module Def Ids that should be searched upon [Optional]. Match is performed only when a SearchTypeId for Module Search Crawler Id.

Declaration
public IEnumerable<int> ModuleDefIds { get; set; }
Property Value
Type Description
IEnumerable<System.Int32>
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

ModuleId

Gets or sets module Id to restrict Search. Value > 0 is used only.

Declaration
public int ModuleId { get; set; }
Property Value
Type Description
System.Int32
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

NumericKeys

Gets or sets restrict search to specific NumericKeys. This field is optional.

Declaration
public IDictionary<string, int> NumericKeys { get; set; }
Property Value
Type Description
IDictionary<System.String, System.Int32>
Remarks

This is key-value pair, e.g. "ItemId","888".

| Improve this Doc View Source

PageIndex

Gets or sets page Index for the result, e.g. pageIndex=1 and pageSize=10 indicates first 10 hits. Default value is 1.

Declaration
public int PageIndex { get; set; }
Property Value
Type Description
System.Int32
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

PageSize

Gets or sets page size of the search result. Default value is 10.

Declaration
public int PageSize { get; set; }
Property Value
Type Description
System.Int32
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

PortalIds

Gets or sets a collection of Portal Ids of the Site to perform Search upon. This field must be specified or else Portal 0 will be searched by default.

Declaration
public IEnumerable<int> PortalIds { get; set; }
Property Value
Type Description
IEnumerable<System.Int32>
Remarks

Search cannot be executed across Sites.

| Improve this Doc View Source

RoleId

Gets or sets role Id to restrict Search. Value > 0 is used only.

Declaration
public int RoleId { get; set; }
Property Value
Type Description
System.Int32
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

SearchContext

Gets or sets context information such as the type of module that initiated the search can be stored here. This is key-value pair, e.g. "SearchSource","SiteSearch"

Declaration
public IDictionary<string, string> SearchContext { get; set; }
Property Value
Type Description
IDictionary<System.String, System.String>
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

SearchTypeIds

Gets or sets a collection of Search Type Ids that should be searched upon [Optional].

Declaration
public IEnumerable<int> SearchTypeIds { get; set; }
Property Value
Type Description
IEnumerable<System.Int32>
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

SortDirection

Gets or sets sort option of the search result. This field is optional.

Declaration
public SortDirections SortDirection { get; set; }
Property Value
Type Description
SortDirections
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

SortField

Gets or sets sort option of the search result. This field is optional.

Declaration
public SortFields SortField { get; set; }
Property Value
Type Description
SortFields
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

TabId

Gets or sets tab Id to restrict Search. Value > 0 is used only.

Declaration
public int TabId { get; set; }
Property Value
Type Description
System.Int32
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

Tags

Gets or sets restrict search to specific tags. This field is optional.

Declaration
public IEnumerable<string> Tags { get; set; }
Property Value
Type Description
IEnumerable<System.String>
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

TitleSnippetLength

Gets or sets maximum length of highlighted title field in the results.

Declaration
public int TitleSnippetLength { get; set; }
Property Value
Type Description
System.Int32
Remarks

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

UniqueKey

Gets or sets a key to uniquely identify a document in the Index.

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

This object should be passed to SearchController to search for Content. KeyWords and PortalId must be specified.

| Improve this Doc View Source

WildCardSearch

Gets or sets a value indicating whether set this to true to perform perform WildCard Search.

Declaration
public bool WildCardSearch { get; set; }
Property Value
Type Description
System.Boolean
Remarks

This property is not respected when Keywords contain special boolean phrases "~", "", "&quot;", "&apos;", "and", "or", "+", "-". When this is enabled, an additional OR is performed, e.g. (keyword OR keyword). It adds asterisk at then end to find any words starting with the keyword. There can be performance implications with this setting turned on.

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS