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-10697:fixing categories fields search when converting KalturaMediaEntryFilter to esearch #9195

Merged
merged 7 commits into from
Feb 20, 2020

Conversation

ravitshalem
Copy link
Contributor

@ravitshalem ravitshalem commented Feb 19, 2020

This change is Reviewable

$innerSearchItems = array();
foreach ($values as $value)
{
if (!$statuses)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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);
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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))
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

use ===

@ravitshalem ravitshalem merged commit c99d429 into Orion-15.18.0 Feb 20, 2020
@ravitshalem ravitshalem deleted the Orion-15.18.0-PLAT-10697 branch February 20, 2020 11:39
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.

2 participants