Quantcast
Channel: Optimizely Search & Navigation
Viewing all 6894 articles
Browse latest View live

localized assets and search result


Use Fiddler to inspect query sent to find

$
0
0

I am trying to use Fiddler to track the  queries sent to Find. I added the web.config setting to use a proxy as well. But I get an error when I set the proxy: The remote server returned an error: (400) Bad Request. 

Any Idea how I can overcome this, or how do I use Fiddler to track the queries to Find. I have read a bunch of articles here and they mention to use a proxy. Below is one of them I read:

https://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=147074

Get results from epi server find query under specific page

$
0
0

Hi ,

I have been tring to get search results under specific page(parent page) uisng unified search query, able to get pages (respective parent page) and all media document irrespective of parent page. So I need to finter the document with parent page.

Scenario:

Page and under that page we will have content area may accept  AssociatedDocumentItem (It will contain the document property accept only generic media(Media type)).

When I do search I am able to get Icontent(Pages and documents), but I am not able to find out  relation between document to  AssociatedDocumentItem and Page i.e. document parentbpage 

Below is my query.

 searchQry = searchQry.Filter(x => !x.MatchTypeHierarchy(typeof(SitePageData)) | ((SitePageData)x).Ancestors().Match(parentId)); -- getting all documents and pages under parent. Not able to apply Ancestors().Match for documents.

Regards,

Narayana

Modifying Crawled Content

$
0
0

Hi, I'm working on Find 13.0.1, CMS 11.9.1. We have Find crawling an external site and the results are included in our site search. We have an issue where the search returns too many results for certain search terms as they form part of the crawled sites navigation and footer, so they're repeated on almost every page.

One way we are trying to resolve this is via a scheduled job that will iterate each of the crawled WebContent objects and strip out all the content we don't want.

There's some good documentation here https://world.episerver.com/documentation/developer-guides/find/NET-Client-API/Indexing/ which discusses updating the indexed objects if you have the items ID, the only ID I can find is the SearchHit<WebContent>.Id but I have a feeling this isn't what I'm supposed to be using as neither an Update or Delete works using it.

Below is what I'm using in the scheduled job.

I'm retrieving crawled content using SearchClient.Instance.Search<WebContent>() and iterating the hits (SearchHit<WebContent>)


If I try to update the indexed item I don't get an error but the index isn't modified.

ITypeUpdated<WebContent> updateResult = SearchClient
    .Instance
    .Update<WebContent>(hit.Id)
    .Field(x => x.SearchText, "New Clean Search Text");

Alternatively if I try to delete the item so I can replace it with a new 'cleaned' indexed item I get a "Not Found" error

DeleteResult deleteResult = SearchClient
    .Instance
    .Delete<WebContent>(DocumentId.Create(hit.Id));

Adding a new cleaned index item works OK but would only be a valid option if I can get the delete working.

IndexResult indexResult = SearchClient.Instance.Index(hit.Document);

Has anyone done this before, if so, where can I find the correct ID to pass? Or am I heading down the wrong path altogether.

Thanks,
Jason

GDPR and EPiFind Tracking

$
0
0

We've been asked some questions about the tracking that is used when enabling statistics in EPiFind:

/page/in/searchresults/?_t_id=<ID>&_t_q=<mysearchterm>&_t_tags=langu-age:sv,siteid:<guid>&_t_ip=<XX.XX.XX.XX>&_t_hit.id=<NameSpace>/_68d3ab17-d83c-4f64-ae14-288a48d3ffd0_sv&_t_hit.pos=2

These are visible on links in the search results whenever we enable the Track clicking:

SearchClient.Instance.Statistics().TrackQuery(...)
SearchClient.Instance.Statistics().TrackHit(...)

The main issue here is the namespace and the IP-adress which can, contain sensitive information and our customer asked us to remove at least the IP-address. But this will break the tracking.

Can we send the trackingdata on the backend side in some programatic way so we can keep the URL clean? One idea was to make an async call to the above URL after user clicked but wondered if there was a more elegant way?

How can I fetch all pages with different language version by epi find query using GetContentResult() method

$
0
0

Hi,

Can anyone help me to know  how we can fetch  all pages created with different languages version by epi find query.

My query are mentioned a s below:-

var query = SearchClient.Instance.Search<PublicContentPage>().FilterForVisitor().
OrderByDescending(x => x.StartPublish).Take(1000);
var batch = query.GetContentResult();

Thanks in advance

Possible to boost with weights, without using unified search?

$
0
0

A client complained that the search result was not changed when they set the weights in the Episerver Find admin view. 

If I get it right, those weights are only used when you do a UnifiedSearch (or UnifiedSearchFor). We are doing a .Search<IContent> and GetContentResult, because we need the result as content.

Is there a way to keep the current funtionality and let the client set weight in admin mode?

I'm guessing that what I want to do is either

  • Boost with weights, without using UnifiedSearch
  • Or, simulate GetContentResult when using UnifiedSearch. But there doesn't seem to be a "content id" in the UnifiedSearchResults.

Or should I tell the client to ignore the weight setting in admin mode, and we set the boosting in code using .BostMatching?

Thanks for any advise!

 

Episerver Find Search Statistics Click tracking search result issue

$
0
0

I am trying to implement click tracking using EPiServer Find for a CMS application. I am able to generate the statistics but the page name in the search results is showing up as page not found.

Below is a screen shot for reference: https://www.screencast.com/t/ywkYtn9L

Any info on this will be of great help to me.


Another question on Searching multiple Fields

$
0
0

If I have the code below, but I want to search more than one field for given values that I KNOW, how do I do that?

            var searchRequest = new EPiServer.Find.Api.SearchRequestBody
            {
                Size = 1,
                From = 0,
                Query = new EPiServer.Find.Api.Querying.Queries.FieldQuery("SearchFilename$$string",filename)
            };
            var searchHits = client.Search<RemoteHostedContentItem>(searchRequest, command => { });

What values to use for Min Similarity in a fuzzy query

$
0
0

Hi, I'm working on Find 13.0.1, CMS 11.9.1.

We have added in fuzzy logic to our find query setup. This includes MinSimilarity functionality. However we can't find anything online that says what values to use here. We notice differences when setting MinSimilarity to a whole number such as 0,1 or 2. However, setting it to a decimal brings back the same results as the closest whole number. We are not 100% sure what should be returned. If I search for "Nursing" but spell it wrong e.g "Nrsing" I would expect it to return "Nursing" results if Min Similarity is set to 1. However if I get two letters wrong in the search term then I would expect no results unless I set Min Similarity to 2. Am I right in how this should work? Also do the mistakes need to be right next to each other?

Any help is much appreciated.

"Page not found" inside Find for "Search Phrases"

$
0
0

If I go to "/Find/#manage" and click on an item in the "Search Phrase" list I see that all "Search Result" names are named "Page not found" even though the user always visits an existing page and the index documents all contain the key "SearchTitle" with a value.

What's the reason I can't see the real page title?

Thanks

FIND-3565

How to index data from a api in Find

$
0
0

Hi guys, 

In a project, I have built a news archive page type and a news page type in CMS for showing the press releases. 

The data that shows on a news page get from a api (with querystring parmeter in url Http://locallsot:17000/news/?item_id=123456&type_of_media=news)

http://www.mynewsdesk.com/services/pressroom/view/unique key/?[item_id=id]&[type_of_media=pressrelease]

My question is how can I index the data in Find? The data gets directly from api and send to frontend in a reach compoent. 

string xmlStr;
using (var wc = new WebClient())
{
wc.Encoding = Encoding.UTF8;
xmlStr = wc.DownloadString(Api);
}
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlStr);
var item = new News();

foreach (XmlNode node in doc.SelectNodes("item"))
{
item.Header = node.SelectSingleNode("header").InnerText;
item.PublishDate = node.SelectSingleNode("published_at").InnerText;
item.Body = node.SelectSingleNode("body").InnerText;
if (node.SelectSingleNode("image") != null)
item.Image = node.SelectSingleNode("image").InnerText;

News = item;
}


public News news { get; set; }



Thanks!


                       

FIND-3596

$
0
0

This sorting issue(FIND-3596) is quite anoying for us, what exact version will fix this?

As it now states that its fixed, but does not specify what version includes fix.

Projecting ContentReference on GetResult

$
0
0

Hi all,

I'm using EpiServer Find v12.3.2.0 and I have a problem with projections. Code is

return query.Select(a => new SearchHit
                {
                    Title = a.DisplayName,
                    Description = a.Description,
                    ImageLink = a.ImageLink,
                    Link = a.ContentLink
                })
                .GetResult();

and the SearchHit class is

    public class SearchHit
    {
        public string Title { get; set; }
        public string Description { get; set; }
        public string Details { get; set; }
        public ContentReference Link { get; set; }
        public ContentReference ImageLink { get; set; }
    }

So I thought the problem here is the ContentReference itself. Then I tried to create a intermediate type with Id, WorkId, and ProviderName. That lead to same error which is

EPiServer.Find.ProjectionException: An exception of type JsonSerializationException was thrown while deserializing object. ---> Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'EPiServer.Find.Cms.IndexableContentReference' because the type requires a JSON string value to deserialize correctly. To fix this error either change the JSON to a JSON string value or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'IsExternalProvider$$bool', line 1, position 30.

I have two questions. First, is this a problem related to data on index? (which I think more likely because also projecting to a intermediate class with primitive types is resulting in same error). If not, here comes my second question: is it allowed to project ContentReference type on GetResult?

Thanks in advance,

Tarik.


Fuzzy Matches and Stemming

$
0
0

Hi!

I use Find v13.0.1 and Find.Commerce v10.2.0

Let's say I want to search though Variations:

var variationSearchResult = Search<Variation>().For(searchQuery)
.InField(variation => variation.DisplayName)
.AndInField(variation => variation.Description.AsViewedByAnonymous())

I want to have the exact matches for the DisplayName on the top. Afterwards I want to have the exact matches for the Description. And in the end there should be some results with not exact matches for Display name - so it is ok to have there misprints, stemming, etc.

So basically I thought that something like this can solve this problem:

 .BoostMatching(variation => variation.DisplayName.Match(searchQuery), 13)
 .BoostMatching(variation => variation.DisplayName.MatchFuzzy(searchQuery), 0.1)

But I don't like the results I am getting. For example, some stemming items may appear quite high in the list. The worst thing here is that stemming can work quite badly for Dutch language suggesting completely different words...

EPiServer Find vs IContentRepository.GetDescendents()

$
0
0

Hi,

Using EPiServer CMS 11
Using EPiServer Find 13

I've a requirement to get all decendent pages in couple of places in a site I'm working on, we may also want to narrow the results to a particular type of page.

Is using EPiServer Find a good alternative to GetDescendants? Part of me thinks querying the database by hand may be the fastest option, though that is not as easy to maintain as just using the EPiServer CMS API, but I see other blog posts mentioning that EPiFind may be the best option? This seams dubious to me as EPiFind would require an http call etc etc, while the API should just be able to query the sql server db and get results out real quick, unless EPiFind has some clever caching going on? What is the accepted wisdom on this one?

The use case is we wish to list all blog/news/events/etc pages, and editors add to the list by adding child pages under the parent.

Support for Newtonsoft.Json 11 in Find

$
0
0

Tried to upgrade to the latest version of Newtonsoft.Json today and did not succed since there is not support for it in Find.

The strange thing is that there are different dependency in the different Find-packages:

EPiServer Find Client API.13.0.1
Newtonsoft.Json (≥ 10.0.3 && < 11.0.0)

EPiServer Find CMS Integration.13.0.1
Newtonsoft.Json (≥ 10.0.3)

EPiServer Find Framework Integration.13.0.1
Newtonsoft.Json (≥ 10.0.3)

When will all three packages be updated?

UnifiedSearchRegistry throws LoaderExceptions with missing assemblies

$
0
0

Hi, 


I am in the process of upgrading an EPiServer site, with EPiServer Find from 9.6.1 to 11, and I have stumbled upon a problem I haven't been able to figure out.

When running the following code in an initialization module, we get some LoaderException errors.

    [ModuleDependency(typeof (EPiServer.Web.InitializationModule))]
    public class ContentIndexerInitialization: IInitializableModule
    {
        public void Initialize(InitializationEngine context)
        {
            // Some code before this running fine.
            SearchClient.Instance.Conventions.UnifiedSearchRegistry.ForInstanceOf<ProductPage>();
        }
        public void Uninitialize(InitializationEngine context)
        {
        }
    }

Turning on the Fusion log tells me the following:

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows. 
=== Pre-bind state information ===
LOG: DisplayName = System.Collections.Immutable
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.Collections.Immutable | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Sites/Medlemsportal/Medlemsportal/Pdk.Mp2.Website/
LOG: Initial PrivatePath = C:\Sites\Medlemsportal\Medlemsportal\Pdk.Mp2.Website\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\9dcaf1ff
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\9dcaf1ff
LOG: AppName = 69b46dd
Calling assembly : StructureMap, Version=4.5.1.0, Culture=neutral, PublicKeyToken=null.

I am able to install System.Collections.Immutable 1.1.37 (not 1.2.0 which it asked for in anoter fusion log) and create a binding redicret telling it to use 1.1.37 if asking for a 1.2.0

The problem is that I still get a LoaderException error:

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows. 
=== Pre-bind state information ===
LOG: DisplayName = System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
LOG: Appbase = file:///C:/Sites/Medlemsportal/Medlemsportal/Pdk.Mp2.Website/
LOG: Initial PrivatePath = C:\Sites\Medlemsportal\Medlemsportal\Pdk.Mp2.Website\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\9dcaf1ff
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\9dcaf1ff
LOG: AppName = 69b46dd
Calling assembly : Microsoft.CodeAnalysis.Scripting, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.

And this assembly I can't resolve.
As far as I understand, this Nuget package is only for .NET Core projects, and therefore cannot be intsalled into a .NET framework 4.6.1 / 4.7.2 project.

I have been able to add the Nuget package, but it never gets into the project references. And it does not produce a .dll file which I can use.

The versions I am upgrading from and to:

  • EPiServer.CMS 9.6.1 -> 11.5.4
  • EPiServer.CMS.Core 9.6.1 -> 11.5.4
  • EPiServer.CMS.UI 9.6.1 -> 11.5.4
  • EPiServer.CMS.UI.Core 9.6.1 -> 111.5.4
  • EPiServer.Framework 9.6.1 -> 11.5.4
  • EPiServer.Find 12.0.1 -> 12.7.0 (forced by EPiServer.CMS.Core)
  • EPiServer.Find.Cms 12.0.1 -> 12.7.0 (forced by EPiServer.CMS.Core)
  • EPiServer.Find.Cms.AttachementFilter 12.0.1 -> 12.7.0 (forced by EPiServer.CMS.Core)
  • EPiServer.Find.Framework 12.0.1 -> 12.7.0 (forced by EPiServer.CMS.Core)

We also have the following EPiServer packages installed:

  • EPiServer.Labs.LanguageManager 1.5.2.9000 -> 3.1.6
  • EPiServer.LiveMonitor 8.3.1.90000 -> 8.5.0
  • EPiServer.Logging.Log4net 2.0.0 -> 2.2.2
  • EPiServer.Packaging 3.2.4 -> 3.4.0
  • EPiServer.Packaging.UI 3.2.4 -> 3.4.0
  • EPiServer.VisitorGroupsCriteriaPack 1.2.0.9000 -> 2.0.1

Does anyone have any ideas how to solve / debug this problem any further?

Passing a filter expression to a method

$
0
0

I'm using EPiServer Find to fetch all child pages, and I'm trying to make re-usable method which at it's heart is a Linq statement calling Find. Part of the linq is a "filter" method, which I'd like to be able to pass in. Currently, my method compiles but I cant correctly formulate something to pass into it.

The parameter giving me problems:

Expression<Func<T, Filter>> filterExpression

so i have a method that accepts the above filterExpression, but I've found no way of creating a value for that using types not already supported by the Episerverr Filters, in this instance I'd like to filter by type, but cant find a way to create a new filter to support new types of data. I've tried to use 'DelegateFilterBuilder' but again, new types dont seam to work

The heart of my resuable method I'm trying to create looks like this:

allChildPages = SearchClient.Instance.Search<T>().FilterForVisitor()
.Filter(x => ((PageData)x).Ancestors().Match(pageRef.PageLink.ToString())) // find child pages of 'pageRef'
.Filter<T>(filterExpression) // other potential filter
.OrderByDescending(orderExpression)

Part of my problem is EPiServer.Find.Api.Querying.Filter is an abstract class with nothing but static methods (according to resharper decompile), 

What am i missing? Is there some easy c# syntactic sugar I can use to solve my problem?

Viewing all 6894 articles
Browse latest View live