[PATCH 2 of 2 eac] Configure FTI for a couple of relations

Denis Laxalde denis.laxalde at logilab.fr
Mon Oct 29 11:47:33 CET 2018


Self-applied these this series.

Denis Laxalde a écrit :
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde at logilab.fr>
> # Date 1539866240 -7200
> #      Thu Oct 18 14:37:20 2018 +0200
> # Node ID d6bb2b2b0ed7540e6a75e1a293ca3838344ef638
> # Parent  a586045910695ec224c055b8cbc115de624e8018
> # Available At http://hg.logilab.org/review/cubes/eac
> #              hg pull http://hg.logilab.org/review/cubes/eac -r d6bb2b2b0ed7
> Configure FTI for a couple of relations
> 
> Relations defined inheriting from _agent_relation as well as
> has_citation were missing the "fulltext_container" option (all other
> relations from/to an AuthorityRecord had it). This is so that when a
> plain text search matches a target entity of these relations, the
> AuthorityRecord on the other side of the relation is returned in search
> results.
> 
> Only a new migration for "has_citation" is needed since other relations
> already had a sync_schema_props_perms from previous changeset.
> 
> diff --git a/cubicweb_eac/migration/0.8.0_Any.py b/cubicweb_eac/migration/0.8.0_Any.py
> --- a/cubicweb_eac/migration/0.8.0_Any.py
> +++ b/cubicweb_eac/migration/0.8.0_Any.py
> @@ -7,3 +7,5 @@ for rtype in (
>       'hierarchical_child',
>   ):
>       sync_schema_props_perms(rtype)
> +
> +sync_schema_props_perms('has_citation')
> diff --git a/cubicweb_eac/schema.py b/cubicweb_eac/schema.py
> --- a/cubicweb_eac/schema.py
> +++ b/cubicweb_eac/schema.py
> @@ -186,6 +186,7 @@ class _agent_relation(RelationDefinition
>       cardinality = '1*'
>       inlined = True
>       composite = 'object'
> +    fulltext_container = 'object'
>   
>   
>   @xml_wrap
> @@ -337,6 +338,7 @@ class has_citation(RelationDefinition):
>       object = 'Citation'
>       cardinality = '*1'
>       composite = 'subject'
> +    fulltext_container = 'subject'
>       description = _('reference to an external citation resource')
>   
>   
> 



More information about the saem-devel mailing list