From 44d7c47df1071a8648bbef4b65109d083c991b14 Mon Sep 17 00:00:00 2001 From: marmoure Date: Thu, 19 Oct 2023 17:10:36 +0200 Subject: [PATCH] [doc] doc visibleBy in README --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1274c03..09af8cb 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ For incremental indexing to work, you need to have two sets of unique ids, one f http://www.w3.org/XML/1998/namespace - + @@ -74,6 +74,8 @@ For incremental indexing to work, you need to have two sets of unique ids, one f ``` +An Optional `VisibleBy` attribute can be used to restrict data access when searching the Algolia index + A `rootObject` is equivalent to an object inside an Algolia Index. We create one "rootObject" either for each document, or document fragment (if you specify a path attribute on the rootObject). An `attribute` (represents a JSON object attribute, not to be confused with an XML attribute) is a simple key/value pair that is extracted from the XML and placed into the Algolia object ("rootObject" as we call it). All of the text nodes or attribute values indicated by the "path" on the "attribute" element will be serialized to a string (and then converted if you set an explicit "type" attribute). @@ -86,6 +88,14 @@ An `object` represents a JSON object, and this is where things become fun, we ba The `name` attribute that is available on the "attribute" and "object" elements allows you to set the name of the field in the JSON object of the Algolia index, this means that name names of your data fields can be different in Algolia to eXist if you wish. +## limiting Objects access to certain users +You can limit data access by setting the `visibleBy` attribute in `collection.xconf` then matching the path in your XML data preferably in the header +You can use this example from out test suit + +xml: https://github.com/BCDH/exist-algolia-index/tree/master/src/test/resources/integration/user-specified-visibleBy/VSK.TEST.xml + +collection.xconf https://github.com/BCDH/exist-algolia-index/tree/master/src/test/resources/integration/user-specified-visibleBy/collection.xconf + ## Enable logging in eXist (optional)