inveniosoftware / rfcs

RFCs for Invenio.
https://rfcs.readthedocs.io
4 stars 15 forks source link

rdm: define additional record permissions schema and logic #12

Closed fenekku closed 8 months ago

fenekku commented 5 years ago

This is an extension to RFC #7 . To be verified by implementation work (https://github.com/inveniosoftware/invenio-records-permissions/issues/16).

ppanero commented 5 years ago

@ntarocco I had the same issue in Citadel Search (rebrand of CERN Search). At the moment (8 months ago) there was no way of removing a field form the search in ES (v6.2), maybe now there is one.

The way I solved it was to replicate the behaviour of _all field (which was deprecated in ES, maybe we should also check why). So now in my schemas I have something like:

_access: explicit permissions here
_ data: all fields with content to be searchable

Afterwards by using the ES python DSL, you can specify the field in which the query will be performed (https://github.com/elastic/elasticsearch-dsl-py/blob/master/elasticsearch_dsl/query.py#L12 through params to https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html see "default_field").

However, I recall issues with booleans and dates, because they were not strings so I had to move them out of this default fields.

From my perspective the tasks would be: