We want to search for “OR-SA 1121” but the problem is that “OR” is indexed a sa Stopword. How can we fix this Problem?
This is our code:
```
`private IEnumerable DoIndexSearch(string query, string category, int page, int pageSize, IIndex index,
out long totalResults)
{
var currentCulture = CurrentPage.GetCultureFromDomains().ToLower();
var fields = new string[] { "articleNumber", "nodeName", "articleLead", "content", "lead" };
var operation = index.Searcher
.CreateQuery(IndexTypes.Content).GroupedNot(new string[] { "meta_dontIndexSearch" }, "1")
.And()
.GroupedNot(new[] { "templateID" }, "0")
.And()
.GroupedAnd(new string[] { "path" }, ("-1," + this.GetRootNode().Id).MultipleCharacterWildcard());
if (category == "other")
{
operation = operation.And().GroupedNot(new string[] { "__NodeTypeAlias" }, new string[] { "product", "story", "productTech" });
}
else if (!string.IsNullOrEmpty(category))
{
if (category == "product")
{
operation = operation.And().GroupedOr(new string[] { "__NodeTypeAlias" }, new string[] { "product", "productTech" });
}
else
{
operation = operation.And().GroupedOr(new string[] { "__NodeTypeAlias" }, category);
}
}
if (!string.IsNullOrEmpty(query))
{
char[] separators = { ' ', '/', '-' };
var searchWordList = query.Split(separators);
searchWordList = searchWordList.Where(x => x != "").ToArray();
searchWordList = searchWordList.Where(x => !string.IsNullOrEmpty(x)).ToArray();
operation = searchWordList.Aggregate(operation, (current, searchWord) => current.And()
.GroupedOr(fields,
(!string.IsNullOrEmpty(searchWord) ? searchWord + "*" : searchWord).MultipleCharacterWildcard()));
}
var results = operation.OrderByDescending(new SortableField("articleNumber", SortType.String))
.Execute();
if (results == null) return DefaultSearchResult(out totalResults);
totalResults = results.TotalItemCount;
var searchResults = GetResultsAsPublishedContents(results);
var firstPart = searchResults.Where(x =>
x.HasValue("articleNumber") && x.Value<string>("articleNumber")[0].ToString() == query).OrderByDescending(x => x.Value<string>("articleNumber"));
var secondPart = searchResults.Where(x =>
x.HasValue("articleNumber") && x.Value<string>("articleNumber")[1].ToString() == query);
var specialList = firstPart.Concat(secondPart);
var lastPart = searchResults.Where(x =>
(x.HasValue("articleNumber") && x.Value<string>("articleNumber")[0].ToString() != query) || !x.HasProperty("articleNumber"));
var newOrderedList = specialList.Concat(lastPart);
var pagedList = GetPagedResults(page, pageSize, newOrderedList);
return pagedList;
} \``