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 commented Feb 19, 2020

This change is Reviewable

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

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

add to the function signature status=array(null)
remote this check

}
}

protected function getCategoryOperator($elasticFieldName, $elasticFieldNamePairing, $value, $status = null)

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

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)

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

Move the code to derived object for entry

}
}

protected function getCategoryOperator($elasticFieldName, $elasticFieldNamePairing, $value, $status = null)

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

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);

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

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)

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

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)

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

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)

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

rename - gtFullNameSearchOperator

{
$innerSearchItems = array();
$values = $this->createValuesArray($fieldValue);
if(count($values))

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

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.

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 19, 2020

Contributor

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 Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.