-
Notifications
You must be signed in to change notification settings - Fork 125
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
Fix actor relation type search, refs #13326 #1106
Conversation
88a7c56
to
b057ebd
Compare
|
||
// Cache result | ||
self::$converseTermIds[$typeId] = $converseTermId; | ||
}; |
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.
stray ';'?
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.
Good catch!
Thanks @sbreker ... I've updated the PR. |
@@ -54,6 +54,7 @@ static function getEsDocsRelatedToTerm($relatedModelClass, $term, $options = []) | |||
|
|||
// Allow for options to override default behavior | |||
$search = !empty($options['search']) ? $options['search'] : new arElasticSearchPluginQuery(); | |||
$search->query->setSize(10000); |
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.
Is this really needed only to get the count?
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.
Removed!
@@ -352,6 +354,59 @@ public function serializeAltNames() | |||
return $serialized; | |||
} | |||
|
|||
public static function serializeObjectDirectRelationTypes($actorId, $relationData) |
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.
Why public and static?
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.
Good point. Made it "protected".
$relationTerm = QubitTerm::getById($typeId); | ||
$converseTerm = $relationTerm->getConverseActorRelationTerm(); | ||
|
||
if ($converseTerm !== null) | ||
{ | ||
$converseTermId = $converseTerm->id; | ||
} |
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.
It's great that you cached them but I think we should use raw SQL in here, even if they are a few it should be a pretty easy query.
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.
Good call.
Thanks @mcantelon! Just a couple of questions and a suggestion, but feel free to disregard. PS. Somehow this wasn't included in the initial review. |
Thanks @Radda ! I've updated the PR. |
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.
Thanks @mcantelon!
dba4717
to
8516645
Compare
Changed how authority record search by relation type works so only the relation type directly related to an authority record is returned.
8516645
to
9128ff8
Compare
Changed how authority record search by relation type works so only the
relation type directly related to an authority record is returned.