Skip to content
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

PLAT-10143:adding support for double quotes in esearch #8778

Merged
merged 5 commits into from Sep 23, 2019

Conversation

ravitshalem
Copy link
Contributor

No description provided.


protected static function handleInnerQuotes($searchTerm, $itemType, $itemFieldName)
{
$searchTermParts = explode(' ', $searchTerm);
Copy link
Contributor

Choose a reason for hiding this comment

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

Break the text using regex to support - no space between quotes , single or double , any type of whitespace -
"/('|"){1}[^\'\"]+('|"){1}|(\s){1}[^\'\"]+(\s){1}/"

}
return array($object_to_fill, $props_to_skip);
}
if ($itemType === KalturaESearchItemType::PARTIAL && preg_match_all('/(\'|\"){1}[^\'\"]+(\'|\"){1}|[^\'\"]*/', $searchTerm, $matches))
Copy link
Contributor

Choose a reason for hiding this comment

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

else

@@ -54,19 +67,88 @@ public static function eSearchItemToObjectImpl(&$eSearchItem, $dynamicEnumMap, $
}


private static function shouldChangeToExact($searchTerm, $itemType)
protected static function shouldBeExactWithTrim($searchTerm)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Use regex to make sure it is enclosedInQuationMarks

@ravitshalem ravitshalem merged commit 5360a74 into Orion-15.8.0 Sep 23, 2019
@ravitshalem ravitshalem deleted the Orion-15.8.0-PLAT-10143 branch September 23, 2019 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants