Allow errors in Lucene.Net.QueryParsers.QueryParser to be avoided by disabling the full text search engine in Web.config #16

Closed
jeremy-jameson opened this Issue Jan 31, 2012 · 7 comments

Comments

Projects
None yet
2 participants
@jeremy-jameson

When running Subtext 2.5 on my blog, I encountered errors similar to the following:

Lucene.Net.QueryParsers.ParseException: Encountered " ":" ": "" at line 1, column 18. Was expecting one of: ... ... ... "+" ... "-" ... "(" ... "*" ... "^" ... ... ... <FUZZY_SLOP> ... ... ... "[" ... "{" ... ...

This is due to code in the SubtextMasterPage class that automatically attempts to show related blog posts when a user locates a post via an external search engine (such as Google).

While these parsing errors may have been fixed in a more recent build of Lucene.NET -- and some Subtext users may like the "auto-suggest" functionality -- Subtext should still provide a way to disable this feature (and consequently avoid potential errors as a result).

jeremy-jameson added a commit to jeremy-jameson/Subtext that referenced this issue Jan 31, 2012

#16 - Allow errors in Lucene.Net.QueryParsers.QueryParser to be avoi…
…ded by disabling the full text search engine in Web.config
@simonech

This comment has been minimized.

Show comment Hide comment
@simonech

simonech Jan 31, 2012

Collaborator

Yes, I know depends on the query string, and it breaks if the query string has +.
Lucene can be disabled in the web.config already

Simone Chiaretta
Microsoft MVP ASP.NET - ASPInsider
Blog: http://codeclimber.net.nz
RSS: http://feeds2.feedburner.com/codeclimber
twitter: @simonech

Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"

On 31/gen/2012, at 19:55, Jeremy Jameson wrote:

When running Subtext 2.5 on my blog, I encountered errors similar to the following:

Lucene.Net.QueryParsers.ParseException: Encountered " ":" ": "" at line 1, column 18. Was expecting one of: ... ... ... "+" ... "-" ... "(" ... "*" ... "^" ... ... ... <FUZZY_SLOP> ... ... ... "[" ... "{" ... ...

This is due to code in the SubtextMasterPage class that automatically attempts to show related blog posts when a user locates a post via an external search engine (such as Google).


Reply to this email directly or view it on GitHub:
#16

Collaborator

simonech commented Jan 31, 2012

Yes, I know depends on the query string, and it breaks if the query string has +.
Lucene can be disabled in the web.config already

Simone Chiaretta
Microsoft MVP ASP.NET - ASPInsider
Blog: http://codeclimber.net.nz
RSS: http://feeds2.feedburner.com/codeclimber
twitter: @simonech

Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"

On 31/gen/2012, at 19:55, Jeremy Jameson wrote:

When running Subtext 2.5 on my blog, I encountered errors similar to the following:

Lucene.Net.QueryParsers.ParseException: Encountered " ":" ": "" at line 1, column 18. Was expecting one of: ... ... ... "+" ... "-" ... "(" ... "*" ... "^" ... ... ... <FUZZY_SLOP> ... ... ... "[" ... "{" ... ...

This is due to code in the SubtextMasterPage class that automatically attempts to show related blog posts when a user locates a post via an external search engine (such as Google).


Reply to this email directly or view it on GitHub:
#16

@jeremy-jameson

This comment has been minimized.

Show comment Hide comment
@jeremy-jameson

jeremy-jameson Jan 31, 2012

I must have missed something in the Web.config file. I just looked again (searching for both "Lucene" and "search") but I couldn't find it.

Which Web.config element would I tweak if I want to disable Lucene.Net in Subtext?

I must have missed something in the Web.config file. I just looked again (searching for both "Lucene" and "search") but I couldn't find it.

Which Web.config element would I tweak if I want to disable Lucene.Net in Subtext?

@simonech

This comment has been minimized.

Show comment Hide comment
@simonech

simonech Jan 31, 2012

Collaborator

just add IsEnabled="False" in the FullTextSearchEngineSettings tag

Simone Chiaretta
Microsoft MVP ASP.NET - ASPInsider
Blog: http://codeclimber.net.nz
RSS: http://feeds2.feedburner.com/codeclimber
twitter: @simonech

Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"

On 31/gen/2012, at 21:39, Jeremy Jameson wrote:

I must have missed something in the Web.config file. I just looked again (searching for both "Lucene" and "search") but I couldn't find it.

Which Web.config element would I tweak if I want to disable Lucene.Net in Subtext?


Reply to this email directly or view it on GitHub:
#16 (comment)

Collaborator

simonech commented Jan 31, 2012

just add IsEnabled="False" in the FullTextSearchEngineSettings tag

Simone Chiaretta
Microsoft MVP ASP.NET - ASPInsider
Blog: http://codeclimber.net.nz
RSS: http://feeds2.feedburner.com/codeclimber
twitter: @simonech

Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"

On 31/gen/2012, at 21:39, Jeremy Jameson wrote:

I must have missed something in the Web.config file. I just looked again (searching for both "Lucene" and "search") but I couldn't find it.

Which Web.config element would I tweak if I want to disable Lucene.Net in Subtext?


Reply to this email directly or view it on GitHub:
#16 (comment)

@jeremy-jameson

This comment has been minimized.

Show comment Hide comment
@jeremy-jameson

jeremy-jameson Jan 31, 2012

Yeah, I already figured that part out before. However, without the change I made to SubtextMasterPage, won't an error still occur?

Yeah, I already figured that part out before. However, without the change I made to SubtextMasterPage, won't an error still occur?

@simonech

This comment has been minimized.

Show comment Hide comment
@simonech

simonech Jan 31, 2012

Collaborator

It's handled in the DI setup code, if enabled is false, the Lucene provider that is instantiated is a "null" provider that does nothing

Collaborator

simonech commented Jan 31, 2012

It's handled in the DI setup code, if enabled is false, the Lucene provider that is instantiated is a "null" provider that does nothing

@jeremy-jameson

This comment has been minimized.

Show comment Hide comment
@jeremy-jameson

jeremy-jameson Jan 31, 2012

Ah...makes sense. It looks like I was a little "overzealous" after seeing the errors on my Production site. Thanks for the clarification.

Ah...makes sense. It looks like I was a little "overzealous" after seeing the errors on my Production site. Thanks for the clarification.

@jeremy-jameson

This comment has been minimized.

Show comment Hide comment
@jeremy-jameson

jeremy-jameson Jan 31, 2012

Closing

Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment