-
Notifications
You must be signed in to change notification settings - Fork 174
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-10697:fixing categories fields search when converting KalturaMediaEntryFilter to esearch #9195
Conversation
…iaEntryFilter to esearch
…iaEntryFilter to esearch
…iaEntryFilter to esearch
$innerSearchItems = array(); | ||
foreach ($values as $value) | ||
{ | ||
if (!$statuses) |
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.
add to the function signature status=array(null)
remote this check
} | ||
} | ||
|
||
protected function getCategoryOperator($elasticFieldName, $elasticFieldNamePairing, $value, $status = null) |
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.
use array of fieldNames
@@ -252,6 +285,44 @@ protected function AddFieldPartToQuery($searchItemType, $elasticFieldName, $fiel | |||
$this->addToSearchItemsByField($elasticFieldName, $searchItem); | |||
} | |||
|
|||
protected function addCategoryMultiQuery($elasticFieldName, $elasticFieldNamePairing, $fieldValue, $operatorType, $statuses = null) |
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.
Move the code to derived object for entry
} | ||
} | ||
|
||
protected function getCategoryOperator($elasticFieldName, $elasticFieldNamePairing, $value, $status = null) |
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.
move to entry
protected function getCategoryOperator($elasticFieldName, $elasticFieldNamePairing, $value, $status = null) | ||
{ | ||
$searchItem = $this->addSearchItem($elasticFieldName, $value, ESearchItemType::EXACT_MATCH, false, $status); | ||
$searchItemPairing = $this->addSearchItem($elasticFieldNamePairing, $value, ESearchItemType::EXACT_MATCH, false, $status); |
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.
Add status here!
@@ -288,41 +359,34 @@ protected function addSearchItem($elasticFieldName, $value, $itemType, $range = | |||
return $searchItem; | |||
} | |||
|
|||
protected function getSearchItemForCategories($values, $searchType) | |||
protected function handleFullNameCategory($elasticFieldName, $fieldValue, $operatorType) |
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.
move to Entry
@@ -288,41 +359,34 @@ protected function addSearchItem($elasticFieldName, $value, $itemType, $range = | |||
return $searchItem; | |||
} | |||
|
|||
protected function getSearchItemForCategories($values, $searchType) | |||
protected function handleFullNameCategory($elasticFieldName, $fieldValue, $operatorType) |
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.
remove elasticFieldName, operatorType
@@ -288,41 +359,34 @@ protected function addSearchItem($elasticFieldName, $value, $itemType, $range = | |||
return $searchItem; | |||
} | |||
|
|||
protected function getSearchItemForCategories($values, $searchType) | |||
protected function handleFullNameCategory($elasticFieldName, $fieldValue, $operatorType) |
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.
rename - gtFullNameSearchOperator
{ | ||
$innerSearchItems = array(); | ||
$values = $this->createValuesArray($fieldValue); | ||
if(count($values)) |
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.
Not needed
$innerSearchItems = array(); | ||
foreach ($values as $value) | ||
{ | ||
if(substr($value, -1) == '>') //value is parent, we should retrieve entries that doesn't belong directly to this category - but only to the sub categories. |
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.
use ===
This change is