EZP-30759: Creating content with terminal escape codes chars inside Searchable field will return 500 error when using Solr#159
Conversation
…earchable field will return 500 error when using Solr
mateuszbieniek
approved these changes
Oct 25, 2019
andrerom
approved these changes
Oct 28, 2019
Contributor
andrerom
left a comment
There was a problem hiding this comment.
+1 with comments fixed :)
| 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]#" |
Contributor
There was a problem hiding this comment.
Comment with link to Solr issue here so we can track it.
| protected $sectionHandler; | ||
|
|
||
| /** | ||
| * @var string |
Contributor
There was a problem hiding this comment.
Maybe something like this (here and on the others):
Suggested change
| * @var string | |
| * @var string Pattern with special characters that should be stripped from field value due to Solr not accepting them. |
|
-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. '['. |
Merged
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1.5and 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.5can 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.