Skip to content
This repository has been archived by the owner on Nov 21, 2021. It is now read-only.

Commit

Permalink
#16 - Allow errors in Lucene.Net.QueryParsers.QueryParser to be avoid…
Browse files Browse the repository at this point in the history
…ed by disabling the full text search engine in Web.config
  • Loading branch information
jeremy-jameson committed Jan 31, 2012
1 parent ac90a41 commit a34b8ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Subtext.Web/UI/Pages/SubTextMasterPage.cs
Expand Up @@ -99,13 +99,19 @@ public void InitializeControls(ISkinControlLoader controlLoader)
{
entryId = entry.Id;
}
var query = Query;
if (!String.IsNullOrEmpty(query))

// Allow errors in Lucene.Net.QueryParsers.QueryParser to be avoided by
// disabling the full text search engine in Web.config
if (FullTextSearchEngineSettings.Settings.IsEnabled == true)
{
var searchResults = SearchEngineService.Search(query, 5, Blog.Id, entryId);
if (searchResults.Any())
var query = Query;
if (!String.IsNullOrEmpty(query))
{
AddMoreResultsControl(searchResults, controlLoader, apnlCommentsWrapper);
var searchResults = SearchEngineService.Search(query, 5, Blog.Id, entryId);
if (searchResults.Any())
{
AddMoreResultsControl(searchResults, controlLoader, apnlCommentsWrapper);
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/Subtext.Web/Web.config
Expand Up @@ -18,6 +18,12 @@
<add name="subtextData" connectionString="Server=.\SQLEXPRESS;Database=SubtextData;Trusted_Connection=True;User Instance=false;" />
</connectionStrings>
<FullTextSearchEngineSettings type="Subtext.Framework.Configuration.FullTextSearchEngineSettings, Subtext.Framework">
<!-- Change the following to false to prevent related posts from automatically
being suggested when users find a post using an Internet search engine
(e.g. Google). This will also avoid potential errors in Lucene.Net
(e.g. Lucene.Net.QueryParsers.ParseException: Encountered " ":" ": "" at
line 1, column ... Was expecting one of: ...). -->
<IsEnabled>true</IsEnabled>
<Parameters>
<MinimumDocumentFrequency>10</MinimumDocumentFrequency>
</Parameters>
Expand Down

1 comment on commit a34b8ff

@simonech
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not only the related posts... the setting enables and disables all Lucene

Please sign in to comment.