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

update README.md #11

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ eXist Indexer for Algolia is a configurable index plug-in for the [eXist-db](htt

## Installation

The Algolia indexer is dependent on https://github.com/BCDH/cql-module follow the install instructions in the `README`.

It's probably a good idea to start with a clean database, which means a completely clean `$EXIST_HOME/webapp/WEB-INF/data` folder.

* The Index plugin requires at least eXist version 3.0.
Expand All @@ -19,7 +21,7 @@ It's probably a good idea to start with a clean database, which means a complete

- Make sure eXist is not running

- Place the jar file named like `exist-algolia-index-assembly-2.13_1.0.0.jar` into eXist's `lib/user`.
- Place the jar file named like `exist-algolia-index-assembly-2.13_1.0.0.jar` into eXist's `lib/user`, `lib` for eXist-db-6.x.x.

- Modify eXist's `conf.xml` file by adding the following line to the `indexer/modules` section:

Expand All @@ -30,6 +32,17 @@ It's probably a good idea to start with a clean database, which means a complete
admin-api-key="YOUR-ALGOLIA-ADMIN-API-KEY"/>
```

### just for exist-6.x.x
- add the dependency in `etc/startup.xml`
```xml
<dependency>
<groupId>Your group id</groupId>
<artifactId>AlgoliaIndex</artifactId>
<version>1.1.0</version>
<relativePath>exist-algolia-index-assembly-1.1.0-SNAPSHOT.jar</relativePath> <!-- this should reflect the exact filename you placed in the lib folder in lib folder -->
</dependency>
```

- Startup eXist.

- For the Collection(s) that you want to index with Algolia, you need to add an Algolia index configuration to eXist's `collection.xconf` file. See [instructions](#collectionconf).
Expand Down Expand Up @@ -58,7 +71,7 @@ For incremental indexing to work, you need to have two sets of unique ids, one f
<namespace>http://www.w3.org/XML/1998/namespace</namespace>
</namespaceMapping>
</namespaceMappings>
<index name="my-algolia-index-1" documentId="/path/to/unique-id/@хml:id">
<index name="my-algolia-index-1" documentId="/path/to/unique-id/@хml:id" visibleBy="/path/to/unique-id">
<rootObject path="/path/to/element" nodeId="@xml:id">
<attribute name="f1" path="/further/patha"/>
<attribute name="f2" path="/further/pathb" type="integer"/>
Expand All @@ -74,6 +87,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).
Expand All @@ -88,6 +103,9 @@ The `name` attribute that is available on the "attribute" and "object" elements

<a name="logging"/>

## 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

## Enable logging in eXist (optional)


Expand Down