Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 397 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Advance filter for category and author in Smartsearch in kentico

#1
I have created basic search and uses the SearchHelper to get smart search results based on the search paramaters.

Now creating the Advance search based on Category , Author etc but did not find the way to filter the result based on these condition.

I am looking for a way to display the results using the dataset that

// Prepare parameters
SearchParameters parameters = new SearchParameters()
{
SearchFor = searchText,
SearchSort = SearchHelper.GetSort(srt),
Path = path,
ClassNames = DocumentTypes,
CurrentCulture = culture,
DefaultCulture = defaultCulture,
CombineWithDefaultCulture = CombineWithDefaultCulture,
CheckPermissions = CheckPermissions,
SearchInAttachments = SearchInAttachments,
User = (UserInfo)CMSContext.CurrentUser,
SearchIndexes = Indexes,
StartingPosition = startPosition,
DisplayResults = displayResults,
NumberOfProcessedResults = numberOfProceeded,
NumberOfResults = 0,
AttachmentWhere = AttachmentsWhere,
AttachmentOrderBy = AttachmentsOrderBy,
BlockFieldOnlySearch = BlockFieldOnlySearch,
};

// Search
DataSet results = SearchHelper.Search(parameters);
Reply

#2
The easiest way is to use the method:

SearchHelper.CombineSearchCondition()

The first parameter is the searchText, with the search terms you probably already have.

The second parameter is searchConditions, which can be formatted as per

[To see links please register here]


Alternatively you could just append your search conditions to your search text manually, separating each term with a space.

Remember that to filter based on any field they need to be selected as searchable in the SiteManager->Development->DocumentTypes->DocumentType->Search Tab.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through