Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Are you seeing the words added when you run Synonyms().List()? http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/9/DotNET-Client-API/Searching/Synonyms/
Try specifying .InField() - .InField(x => x.SearchText()) and .InField(x => x.SearchTitle()) for instance.
Is this index hosted in an on premise solution?
Been trying to get synonyms working. But when I add it to my query I just get empty results back. Code is as follows. (with out the UsingSynonyms() everything works fine)
var query = searchInstance.Search<BasePageData>(Language.Swedish) .For(args.Query) .UsingSynonyms() .FilterForVisitor(); query = query.Filter(x => !x.Ancestors().Match(currentPage.StartPage.ArchivePage.ID.ToString())); // Add filter for SearchType if (!string.IsNullOrEmpty(args.SearchType)) query = query.Filter(x => x.SearchTypeName.Match(args.SearchType)); // Add filter for SiteId query = query.Filter(x => x.SiteId().Match(args.SiteId)); // Setting up paging if (string.IsNullOrEmpty(args.Pagnation)) currentPage.PagingPage = 1; else currentPage.PagingPage = Convert.ToInt16(args.Pagnation); var searchHitQuery = AddProjection(jobsearchpageUrl, query, 200) .Skip((currentPage.PagingPage - 1) * currentPage.HitsToShow) .Take(currentPage.HitsToShow) .ApplyBestBets() .Track(); currentPage.Results = searchHitQuery.GetResult(); private ISearch<SearchHit> AddProjection(string jobsearchpageUrl, ITypeSearch<BasePageData> query, int searchTextLength) { return query.Select(x => new SearchHit { Title = x.Name, Text = x.SearchText().AsCropped(searchTextLength), Url = x.LinkURL, PublishedDate = x.StartPublish, SearchType = x.SearchTypeName, SiteId = x.SiteId() }) .IncludeType<SearchHit, Assignment>(x => new SearchHit { Title = x.Localization.AssignmentLoc.AssignmentTitle, Url = jobsearchpageUrl, AssignmentUrl = string.Format("id/?assign={0}", x.Guid), PublishedDate = x.PublishStartDate, SearchType = x.SearchTypeName, SiteId = x.SiteId }) .IncludeType<SearchHit, MediaData>(x => new SearchHit { Title = x.Name, Url = UrlResolver.Current.GetUrl(x.ContentLink), PublishedDate = (DateTime)x.SearchPublishDate(), FileExtention = x.SearchFileExtension(), SearchType = GetListItemType(x.SearchFileExtension()), SiteId = x.SiteId() }) .IncludeType<SearchHit, EPiServer.Find.Framework.WebContent>(x => new SearchHit { Title = x.SearchTitle, Url = x.SearchHitUrl, Text = x.SearchText.AsCropped(searchTextLength), PublishedDate = new DateTime(), SearchType = GetWebContentType() }); }
Anyone seening my mistake?