-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-30759: Creating content with terminal escape codes chars inside Searchable field will return 500 error when using Solr #159
base: 1.5
Are you sure you want to change the base?
Conversation
…earchable field will return 500 error when using Solr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 with comments fixed :)
@@ -10,6 +10,7 @@ parameters: | |||
ezpublish.search.solr.field_mapper.location.class: EzSystems\EzPlatformSolrSearchEngine\FieldMapper\LocationFieldMapper\Aggregate | |||
ezpublish.search.solr.field_mapper.boost_factor_provider.class: EzSystems\EzPlatformSolrSearchEngine\FieldMapper\BoostFactorProvider | |||
ezpublish.search.solr.field_mapper.boost_factor_provider.map: [] | |||
ez_search_engine_solr.invalid_characters_pattern: "#\\x1b[[][^A-Za-z]*[A-Za-z]#" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment with link to Solr issue here so we can track it.
@@ -42,22 +42,30 @@ class BlockDocumentsBaseContentFields extends ContentFieldMapper | |||
*/ | |||
protected $sectionHandler; | |||
|
|||
/** | |||
* @var string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like this (here and on the others):
* @var string | |
* @var string Pattern with special characters that should be stripped from field value due to Solr not accepting them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'regexp pattern' ?
-1. We should quote special chars instead of stripping them out. Esp. if this is done pervasively. Do you prohibit single quotes chars from ever being stored in varchar fields in databases? |
ps: I agree about filtering out a very limited set of characters, but not fe. '['. |
1.5
and higherThis PR fixes the issue described in the mentioned JIRA ticket. The simple solution is to filter out all the terminal escape characters but just for Solr as Legacy storage handles it without any issue.
I'll add type hints on merge up, as
1.5
can be used with eZ Platform v1.x on PHP 5.x.I'm about to create an issue in Solr's JIRA tracker, but as for now, I'm waiting for their devs to confirm that from their perspective this can be considered as a bug. I'll update the PR and add a comment in the code once the issue is created.