I want to retrieve results based on a filed condition as follows:
I got a table "xyz" which has a particular column (ShareCOMSPage) which contains multiple choice value such as "IT","CS|ECE","CS|LLB",etc...as attached in this photo. I am using Lucene search engine and following query works fine for 1 value "IT"
shareCOMSPage = SearchSyntaxHelper.GetFieldCondition(PageTypes.COMSPage.Fields.ShareCOMSPage, "IT"); query = SearchSyntaxHelper.AddSearchCondition(query, shareCOMSPage);
But what I want is to query on the field "ShareCOMSPage" which contains "IT" or "ECE". I use term contains because 3rd and 4th data from above photo contain "ECE".
Can anyone help me how to achieve this using SearchSyntaxHelper. Thanks in advance
Hi, I solved this using following way.
shareCOMSPage = SearchSyntaxHelper.GetFieldCondition(SearchIndexes.Fields.ShareCOMSPage, $"(IT OR ECE)");
query = SearchSyntaxHelper.AddSearchCondition(query, shareCOMSPage);
Please, sign in to be able to submit a new answer.