How I can search searchable fields in SearchHelper.Search(parameters)

Vlad Bilenko asked on June 19, 2015 11:18

Hi! I have subCategoty column in my doc type wich I marked as "Searchable". How I can perform search by that field with base query? For example I put value "pdf" into "SearchFor" property and I want add "subcategory:44" expression. If I pass that to "SearchFor" prop it does not work.


SearchParameters parameters = new SearchParameters()
                    SearchFor = "pdf SubCategory:44",
                    SearchSort = null,
                    Path = null,
                    ClassNames = null,
                    CurrentCulture = "###ALL###",
                    DefaultCulture = null,
                    CombineWithDefaultCulture = false,
                    CheckPermissions = false,
                    SearchInAttachments = false,
                    User = MembershipContext.AuthenticatedUser,
                    SearchIndexes = index.IndexName,
                    DisplayResults = 100,
                    NumberOfProcessedResults = 100,
                    NumberOfResults = 100,
                    AttachmentWhere = null,
                    AttachmentOrderBy = null,

                // Search
                System.Data.DataSet results = SearchHelper.Search(parameters);

Correct Answer

Roman Koníček answered on June 23, 2015 21:22

Hi Vlad,

In case you are using a field search and search for numbers, the syntax must be the following: SubCategory:(int)44.

Best regards, Roman Konicek

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.