I am trying to move my code from Lucene to Solr, but am facing an issue. I have 4 fields indexed, all the field are of text_general type (from the managed schema). The code from Lucene is:
filterSearchText = filterSearchText.Or(x => x.LastName.Contains(searchRequest.Keyword));
filterSearchText = filterSearchText.Or(x => x.Content.Contains(searchRequest.Keyword));
filterSearchText = filterSearchText.Or(x => x.RelatedContent.Contains(searchRequest.Keyword));
filterSearchText = filterSearchText.Or(x => x.SearchKeywords.Contains(searchRequest.Keyword));
So whenever I search a single word (e.g. "health") Solr gives the same results as Lucene, but when I search multiple words (e.g. "health ser") it does not give any result. The query is in the logs as follows for single and multiple words:
last_name_t:(*health*) OR _content:(*health*) OR relatedcontent_s:(*health*) OR search_keywords_t:(*health*)
and for multiple words
last_name_t:("\*health ins\*") OR _content:("\*health ins\*") OR relatedcontent_s:("\*health ins\*") OR search_keywords_t:("\*health ins\*")
but when I search for the full keywords such as (e.g. "health services") I get correct results with the query:
last_name_t:("\*Health Services\*") OR _content:("\*Health Services\*") OR relatedcontent_s:("\*Health Services\*") OR search_keywords_t:("\*Health Services\*")
So what is the replacement for finding the substring in Solr?