[ https://issues.apache.org/jira/browse/LUCENENET-169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697200#action_12697200 ]
Corey Trager commented on LUCENENET-169: ---------------------------------------- Regarding Medium Trust, Microsoft's out-of-the-box default Medium Trust config file is what it is. I read that some shared hosting companies tweak it, others don't. Using Lucene.NET in the real world just goes smoother if Lucene.NET doesn't conflict with the Microsoft defaults. Regarding: * Is it correct to use Lucene.Net in an ASP.Net app. or should there be a search service which can be accessed by IIS or directly from client apps? * Isn't it easier to control the lifetime of IndexReader and/or IndexWriter in an application(Console,Windows, Service) other than in IIS. I don't know of any shared hosting company that would let you run your own Windows service, so building Lucene.NET into the ASP.NET code itself is the only realistic practical option. And, for my app, BugTracker.NET, it's working great for me and the hundreds/thousands of people who are also running it. Nobody has reported any issues with the architecture. I've documented how I integrated Lucene.NET into my ASP.NET application here: http://ifdefined.com/blog/post/2009/02/Full-Text-Search-in-ASPNET-using-LuceneNET.aspx > Changes to make Lucene.NET compatible with ASP.NET Medium Trust Level, in > hosting environments (like GoDaddy...) > ----------------------------------------------------------------------------------------------------------------- > > Key: LUCENENET-169 > URL: https://issues.apache.org/jira/browse/LUCENENET-169 > Project: Lucene.Net > Issue Type: Improvement > Environment: ASP.NET > Reporter: Corey Trager > Attachments: FSDirectory.patch > > > Microsoft has a configuration file for shared hosting for what they call > "Medium Trust". There are a couple places in FSDirectory.cs that violate > the restrictions of Medium Trust, but I coded workarounds, shown below. > #1) > // Corey Trager, Oct 2008: Commented call to GetTempPath to workaround > permission restrictions at shared host. > // LOCK_DIR isn't used anyway. > public static readonly System.String LOCK_DIR = null; // > SupportClass.AppSettings.Get("Lucene.Net.lockDir", > System.IO.Path.GetTempPath()); > #2) > /// <summary>Returns an array of strings, one for each Lucene > index file in the directory. </summary> > public override System.String[] List() > { > /* Changes by Corey Trager, Oct 2008, to workaround permission restrictions > at shared host */ > System.IO.DirectoryInfo dir = new > System.IO.DirectoryInfo(directory.FullName); > System.IO.FileInfo[] files = dir.GetFiles(); > string[] list = new string[files.Length]; > for (int i = 0; i < files.Length; i++) > { > list[i] = files[i].Name; > } > return list; > /* end of changes */ > // System.String[] files = > SupportClass.FileSupport.GetLuceneIndexFiles(directory.FullName, > IndexFileNameFilter.GetFilter()); > // for (int i = 0; i < files.Length; i++) > // { > // System.IO.FileInfo fi = new System.IO.FileInfo(files[i]); > // files[i] = fi.Name; > // } > // return files; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.