November Happy Hour will be moved to Thursday December 5th.

"New EPiServer FInd" Breaking changes?

Vote:
 

I just updated one site to "New EPiServer Find" and two things broked down for me:

var result = StatisticsClient.Instance.GetSpellCheck(query, take);

and

var result = StatisticsClient.Instance.GetAutoComplete(query, take * 2);

This is because this is no longer availible "using EPiServer.Find.Framework.Statistics.ForInternalUseOnly;" (Yes, I know that the name should made me not use it but... ;-) )

I can't find any articles on breaking changes yet, are there any and is there any more changes you know about?

#86407
May 21, 2014 9:03
Vote:
 

Hi Henrik =)

Use 

var client = Client.CreateFromConfig();
var statisticsClient = client.Statistics();


#86416
Edited, May 21, 2014 10:24
Vote:
 

Hi Niklas. 

Thanks! That is a mutch more clean solution :)

#86421
May 21, 2014 11:04
Vote:
 
StatisticsClient.GetTopQueries(topQueriesSize)

The method GetTopQueries does not exist anymore. Does anyone know where I can find it or do the same call in some other way?

Thanks

#86493
May 22, 2014 15:07
Vote:
 

Hi Erik,

This was something we used to use internally for the old UI. We removed the method when we had no use for it. Obviously there is a need for it so I will make sure that it is included in the next release.

/Marcus

#86536
May 23, 2014 9:31
Vote:
 

We are working on gett ing an accurate updated breaking change document up as soon as possible

#86539
May 23, 2014 9:46
Vote:
 

Thanks Marcus

More questions:

1. Is the same index compatible with both version 7 and 8 of Find?

2. When calling var statisticsClient = client.Statistics();i get an error for our dev-index (I have activated stats on find.episerver.com)
Your index does not support statistics. Please contact support to have your account upgraded.

3. Is there any workaroud for this GetTopQueries right now? Can I access the index with your interal query and get the same result?

#86540
May 23, 2014 10:05
Vote:
 

As a workaround for the GetTopQueries, you can use something like this:

     public class StatsQueryTop
        {
            public string Query { get; set; }
            public int Count { get; set; }
        }

        public class TopQueryCommand : Command
        {
            private string index;
            private int size;

            public TopQueryCommand(ICommandContext commandContext, string index, int size) : base(commandContext)
            {
                this.index = index;
                this.size = size;
            }

            public StatisticsHitsResult<StatsQueryTop> Execute()
            {
                string url = GetUrl();
                var request = CommandContext.RequestFactory.CreateRequest(url, HttpVerbs.Get, ExplicitRequestTimeout);
                return GetResponse<StatisticsHitsResult<StatsQueryTop>>(request);
            }

            private string GetUrl()
            {
                return string.Format("{0}{1}/_stats/query/top?size={2}", GetServerUrl(), this.index, this.size);
            }
        }

        // TopQueryCommand usage
        public IEnumerable<StatsQueryTop> GetTopQueries(int size)
        {
            var topQueryCommand = searchClient.NewCommand(context => new TopQueryCommand(context, searchClient.DefaultIndex, size));
            return topQueryCommand.Execute().Hits;
        }
#86976
Jun 05, 2014 13:37
Vote:
 

I second Eric's comment about the index not supporting statistics. I also tried to create a brand new index with activated stats, but that did not help.

#87466
Jun 13, 2014 10:56
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.