Problem with search 'like'

Vote:
 

I have noticed that after updating to latest version of EpiFind, I can't find any results using 'like'. For example, let's have a phrase "abcdef", then when I use UnifiedSearch with phrase "abc", it will not return any result. 

Can anybody confirm it?

#216507
Feb 07, 2020 11:41
Vote:
 

Hi Damian,

Have you rebuilt the indexes after the Find package update?

#216512
Feb 07, 2020 12:13
Vote:
 

Hi

Yes, we have reindexing job running every night. 

#216550
Feb 10, 2020 5:45
Vote:
 

Problem has been solved. It seems that we never had wildcard implementation.

After adding implementation provided by Joel Abrahamsson (I can't add here a link) wildcard queries started working. I might be that somebody changed implementation by accident some time ago, but nobody noticed that. 

@Episerver: thanks for support. 

#217221
Feb 19, 2020 15:01
Vote:
 

Just want to say that wildcard search is extremely heavy on Find backend, so if you are using it a lot, you can bring down your Find subscription 

#217224
Feb 19, 2020 16:16
Vote:
 

We have around 50k search requests per day. Is it a lot in that case? Will it be heave even if it's running only for title, not body of each page? What do you mean by bringing down our subscription? Will it work slower becase of the load, or service might be not available at all?

#217284
Feb 20, 2020 8:36
Vote:
 

Hi Damian

We have some recommendation around the use of wildcards here (Scroll down to Wildcard searches section)

https://world.episerver.com/documentation/developer-guides/search-navigation/NET-Client-API/searching/

#218935
Edited, Mar 25, 2020 11:32
Vote:
 

Thanks for that. After your recommendation, we decided to not use wildcard search. We have changed implementation a little bit. We still use UnifiedSearchFor, every word has separate weight 1 point, but when it's found in keywords, then it has 2 points. This imeplementation works correct for us, we are getting results that we are expecting, even if only some letters are matching beggining of single word. The only problem we found here, is it works only for 3 words, after adding 4th, we have no results (probably because of some exception). I will ivestigate it further. 


 public ITypeSearch<ISearchContent> Create(string query, string language)
        {
            var lang = _searchLanguageFactory.Create(language, _client);
            var queriedSearch = _client.UnifiedSearchFor(query, lang);
            var queries = SplitQueryToList(query);
            ITypeSearch<ISearchContent> typeSearch = null;
            foreach (var q in queries)
            {
                if (typeSearch == null)
                {
                    typeSearch = queriedSearch.Include(x => x.SearchTitle.AnyWordBeginsWith(q), 1);
                }
                else
                {
                    typeSearch = typeSearch.Include(x => x.SearchTitle.AnyWordBeginsWith(q), 1);
                }

                typeSearch = typeSearch.Include(x => ((MetaPageBase)x).Keywords.AnyWordBeginsWith(query), 2);
            }

            return typeSearch;
        }

        public List<string> SplitQueryToList(string query)
        {
            var list = query.Split(' ').Select(x => x.Trim()).ToList();
            return list;
        }
    }
#218936
Mar 25, 2020 11:44
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.