Convention for ignoring large files

Member since: 2004

Hi, we're using the latest version of find. How can we make a convention that ignores large files when indexing?

#112866 Nov 06, 2014 14:59
  • Member since: 2009

    Haven't tested this, but you should be able to do something like this:

    ContentIndexer.Instance.Conventions.ForInstancesOf<MediaData>().ShouldIndex(x => !x.IsWayTooBigFile());

           public static bool IsWayTooBigFile(this MediaData mediaData)
               // check file size

    #112869 Nov 06, 2014 15:20
  • Member since: 2009

    Also, you may not want to check the file size every time you try to index. Check out this forum post

    #112870 Nov 06, 2014 15:22
  • Member since: 2004

    Thanks, I had that in mind but thought that maybe there were a more elegant solution.. :) My problem is that when indexing files, the site restarts. Thought that maybe it has something to do with big files..

    #112875 Nov 06, 2014 16:07
  • Member since: 2009


    were the big files related to the site restarting?

    #113031 Edited, Nov 11, 2014 11:47
  • Member since: 2004

    Well, it does still restart. Seems to index a little more before restarting though. This is on a shared server, so it's hard to debug. :(


    Log file says - which gives pretty much nothing in my eyes:

    2014-11-12 11:47:35,376 [72] WARN EPiServer.Framework.Initialization.ShutdownTracker: ASP.NET shutting down due to HostingEnvironment

    2014-11-12 11:47:35,641 [20] ERROR dispose: Nexus.Web.Business.Initialization.RestartModule: Application restarted because:HostingEnvironment
    at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
    at System.Environment.get_StackTrace()
    at System.Web.Hosting.HostingEnvironment.InitiateShutdownInternal()
    at System.Web.Hosting.PipelineRuntime.StopProcessing()
    HostingEnvironment initiated shutdown
    HostingEnvironment caused shutdown

    #113074 Edited, Nov 12, 2014 11:50
  • Member since: 2009

    Have you checked memory/cpu usage when indexing? 

    #113075 Nov 12, 2014 12:01
  • Member since: 2004

    So, now it seems to be solved. Updated Find to the latest version yesterday and I've managed to index the site with files. Happy days. Don't know what the problem was though.

    #113673 Nov 26, 2014 12:02