London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Regarding #2, could you post the code for your search request where this occurs?
Hi,
Regarding #1 the ip tracked is as follows:
if the request contains the HTTP_X_FORWARDED_FOR it will use that value else it will fallback to the HttpContext.Current.Request.UserHostAddress.
It will never look at the server ip so I'm a little suspicious how it shows up in the statistics. If you intercept your trackingrequest in fiddler (path: YOURINDEX/_track) what is the ip-parameter that is passed?
Regards,
Henrik
Regarding #2, I assume you're tracking searches without any query, e.g. a list page.
That's easy fixed with an if-statement.
if (!string.IsNullOrWhiteSpace(yourQuery))
{
query = query.Track();
}
This is what I do:
Results = SearchClient.Instance.Search<ISearchablePage>(Language.Norwegian) .For(Query) .InField(x => x.PageHeader) .AndInField(x => x.PageName) .AndInField(x => x.MainIntro) .AndInField(x => x.BodyText) .TermsFacetFor(x => x.Categories) //.StaticallyCacheFor(TimeSpan.FromMinutes(30)) .Filter(catFilter) //.Filter(x => x.PageHeader.Fuzzy(Query)) .Select(x => new SearchHit() { Title = x.PageHeader ?? x.PageName, Text = FirstNotEmpty( x.MainIntro.AsHighlighted(new HighlightSpec() { FragmentSize = 300, NumberOfFragments = 1, PreTag = "<strong>", PostTag = "</strong>" }), x.MainIntro.AsCropped(300), x.BodyText.AsHighlighted(new HighlightSpec { FragmentSize = 300, NumberOfFragments = 1, PreTag = "<strong>", PostTag = "</strong>" }), x.BodyText.AsCropped(300) ), Url = x.LinkURL, Categories = x.Categories }) .Take(pagingControl.PageSize) .Skip((pagingControl.ActivePageNumber - 1) * pagingControl.PageSize) .Track() .GetResult();
Before I used a trackscript (new Tracking().TrackingScriptUrl) to do the tracking, now Im using the track() funcition (serverside) when i execute the search. I got 2 problems with the new way of doing things: