Skip to content

Commit

Permalink
fixed problem on already existent file index.
Browse files Browse the repository at this point in the history
  • Loading branch information
zmn committed Apr 2, 2017
1 parent 6e354d0 commit a41d850
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
5 changes: 4 additions & 1 deletion Wlog.Library/BLL/Index/LuceneIndexManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ private void InitIndex()
{

logger.Debug("[IndexManager] InitIndex");

if (!string.IsNullOrEmpty(Path) && !System.IO.Directory.Exists(Path))
{
System.IO.Directory.CreateDirectory(Path);
}
logger.Debug("[IndexManager] Opening {0}", Path);
luceneIndexDirectory = settings.GetLuceneIndexDirectory(Path);
logger.Debug("[IndexManager] Creating IndexWriter");
Expand Down
5 changes: 1 addition & 4 deletions Wlog.Library/BLL/Reporitories/IndexRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ private void CreateIndex(string name)
var path = Path.Combine(BasePath, name);
var idx = new LuceneIndexManager(name, path);
idx.CommitSize = int.MaxValue; //commit is owned by the caller.
if (!Directory.Exists(idx.Path))
{
Directory.CreateDirectory(idx.Path);
}

indexList.Add(name,idx );
}

Expand Down
6 changes: 3 additions & 3 deletions Wlog.Web/Global.asax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ protected void Application_Start()

if (installed)
{

_logger.Info("Setup index configuration");
IndexRepository.BasePath = HttpContext.Current.Server.MapPath("~/App_Data/Index/");

_logger.Info("Apply schema changes");
RepositoryContext.Current.System.ApplySchemaChanges();
Expand All @@ -68,8 +69,7 @@ protected void Application_Start()

HangfireBootstrapper.Instance.Start();

_logger.Info("Setup index configuration");
IndexRepository.BasePath = HttpContext.Current.Server.MapPath("~/App_Data/Index/");



_logger.Info("Insert seed data");
Expand Down
4 changes: 2 additions & 2 deletions Wlog.Web/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Server=(localdb)\Projects;initial catalog=HubLink2;Integrated Security=true;</property>
<property name="connection.connection_string">Server=(localdb)\Projects;initial catalog=WebLog_develop;Integrated Security=true;</property>
<property name="dialect">NHibernate.Dialect.MsSql2012Dialect</property>
<property name="current_session_context_class">thread_static</property>
<property name="connection.release_mode">on_close</property>
Expand Down Expand Up @@ -79,7 +79,7 @@
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="owin:AppStartup" value="Wlog.Library.Scheduler.Startup,Wlog.Library" />
<add key="MongoDbNAme" value="startup_log" />
<add key="WlogInstalled" value="False" />
<add key="WlogInstalled" value="True" />
</appSettings>
<!--
Per una descrizione delle modifiche al file web.config, vedere il sito Web all'indirizzo http://go.microsoft.com/fwlink/?LinkId=235367.
Expand Down

0 comments on commit a41d850

Please sign in to comment.