Sign inSign up

jeci/pristy-indexing-trackers

By jeci

•Updated 6 days ago

Standalone indexing trackers for Pristy Search Services — feeds Solr 9 from Alfresco

Image
0

1.5K

jeci/pristy-indexing-trackers repository overview

⁠Pristy Indexing Trackers

Standalone indexing service for Pristy Search Services⁠. It polls an Alfresco Community repository for node, ACL and content changes and indexes them into Solr 9 through SolrJ.

In stock Alfresco Search Services the trackers run inside the Solr webapp. This fork externalizes them into a Spring Boot 3.5 service, so Solr stays vanilla and the two halves are deployed, restarted and tuned independently.


⁠Disclaimer

  • Not affiliated with Hyland / Alfresco. Independent community fork, not supported on Alfresco Enterprise.
  • Built for Alfresco Community, as part of the Pristy⁠ project.
  • Support available from Jeci⁠ on Alfresco Community Edition and on this search module.

⁠Tags

TagContents
1.1.0, 1.0.0, …Released versions, cut from a Git tag. Use these.
latestMoves with the most recent release tag.
develop, stableHead of the corresponding branch. Unstable, for testing only.

Keep this image and jeci/pristy-search-services on the same tag. They are released together and are not tested across versions.

⁠What it does

TrackerRoleDefault cron
ModelTrackerSyncs content models from the repository into Solrevery 10 s
MetadataTrackerIndexes node metadata (properties, paths, aspects)every 5 s
AclTrackerIndexes ACL readers/denied, for permission filteringevery 5 s
ContentTrackerExtracts and indexes text content via repository transformsevery 20 s
CascadeTrackerUpdates child paths when a parent is renamed or movedevery 10 s
CommitTrackerCoordinates Solr commits across the othersevery 5 s
RepairTrackerRe-indexes nodes that previously failedevery minute

It also serves the Solr admin actions that used to live in Solr — SUMMARY, REPORT, NODECHECK, PURGE, REINDEX, BACKUP, RESTORE — on port 8085, in two flavours:

  • GET|POST /api/admin/{action} — idiomatic REST
  • GET /solr/admin/cores?action={ACTION} — same shape as the old Solr admin, so existing tooling keeps working

And a versioned Pristy API (/api/v1): the verdict on one node's indexing, computed from the index and the repository, and a live stream of indexing progress with a standalone page at /indexing.html.

⁠Quick start

Assumes an Alfresco Community repository at http://alfresco:8080/alfresco and a jeci/pristy-search-services container at http://solr:8983/solr.

services:
  trackers:
    image: jeci/pristy-indexing-trackers:1.1.0
    environment:
      ALFRESCO_TRACKER_SOLR_URL: http://solr:8983/solr
      ALFRESCO_TRACKER_SOLR_COLLECTION: alfresco
      ALFRESCO_TRACKER_SOLR_COLLECTIONS: alfresco,archive
      ALFRESCO_TRACKER_SOLR_SECURECOMMS: secret
      ALFRESCO_TRACKER_SOLR_SHAREDSECRET: please-change-me
      ALFRESCO_TRACKER_REPOSITORY_URL: http://alfresco:8080/alfresco
      ALFRESCO_TRACKER_REPOSITORY_SECURECOMMS: secret
      ALFRESCO_TRACKER_REPOSITORY_SHAREDSECRET: please-change-me
    ports:
      - "8085:8085"
    volumes:
      - trackers-models:/opt/solr/data

volumes:
  trackers-models:

Check that it is alive and connected:

curl http://localhost:8085/actuator/health
curl "http://localhost:8085/solr/admin/cores?action=SUMMARY&core=alfresco"

The full compose stack (repository, Solr, trackers, transform service) is in the project repository⁠.

⁠Environment variables

The service reads standard Spring Boot configuration, so every key in application.yml has an environment-variable form. The ones that matter:

⁠Connection to Solr
VariableDefaultPurpose
ALFRESCO_TRACKER_SOLR_URLhttp://localhost:8983/solrBase URL of the Solr node.
ALFRESCO_TRACKER_SOLR_COLLECTIONalfrescoPrimary core.
ALFRESCO_TRACKER_SOLR_COLLECTIONSalfresco,archiveEvery core to track.
ALFRESCO_TRACKER_SOLR_SECURECOMMSnonenone, secret or https.
ALFRESCO_TRACKER_SOLR_SHAREDSECRET—Shared secret in secret mode.
⁠Connection to the repository
VariableDefaultPurpose
ALFRESCO_TRACKER_REPOSITORY_URLhttp://localhost:8080/alfrescoBase URL of the repository.
ALFRESCO_TRACKER_REPOSITORY_SECURECOMMSnonenone, secret or https.
ALFRESCO_TRACKER_REPOSITORY_SHAREDSECRET—Shared secret in secret mode.

The two channels are configured independently: running secret towards the repository and https towards Solr is a supported combination.

⁠Pace and behaviour
VariableDefaultPurpose
ALFRESCO_TRACKER_BATCH_COUNT5000Nodes fetched per pass.
ALFRESCO_TRACKER_CRON_METADATA0/5 * * * * ?Quartz cron, metadata.
ALFRESCO_TRACKER_CRON_ACL0/5 * * * * ?Quartz cron, ACL.
ALFRESCO_TRACKER_CRON_CONTENT0/20 * * * * ?Quartz cron, content.
ALFRESCO_TRACKER_CRON_COMMIT0/5 * * * * ?Quartz cron, commit.
ALFRESCO_TRACKER_CASCADE_TRACKING_ENABLEDtrueCascade path updates.
ALFRESCO_TRACKER_SOLR_HOME/opt/solr/dataWhere the synced content models are persisted.

Every setting has a per-core override: alfresco.tracker.cores.<name>.*, i.e. ALFRESCO_TRACKER_CORES_ARCHIVE_CRON_METADATA. An unset per-core key inherits the global one. Full reference: tracker-configuration.md⁠.

⁠Batch sizes and parallelism

Configurable globally (alfresco.tracker.tuning.*) and per core, e.g. ALFRESCO_TRACKER_TUNING_METADATA_PARALLELISM or ALFRESCO_TRACKER_CORES_ARCHIVE_TUNING_METADATA_PARALLELISM.

KeyDefaultPurpose
node-batch-size50Nodes per batch: one repository metadata call and one Solr update each.
metadata-parallelism8Threads indexing node batches.
acl-parallelism8Threads indexing ACL batches.
content-parallelism8Threads extracting content (load on the transform service).
cascade-parallelism8Threads processing cascade updates.

Raising the parallelism does not speed indexing up: measured on a 30 000-node folder, 4 to 32 threads index in the same time, Solr being the bottleneck. Tune these knobs down, to leave CPU and heap to the other core — the packaged configuration already does so for archive.

⁠JVM

The image sets JAVA_OPTS=-XX:MaxRAMPercentage=75, so the heap follows the container memory limit. Add JVM options through JAVA_TOOL_OPTIONS: overriding JAVA_OPTS drops the heap back to the JVM default of 25%.

⁠Scheduled backups
VariableDefaultPurpose
ALFRESCO_TRACKER_BACKUP_ENABLEDfalseOpt-in.
ALFRESCO_TRACKER_BACKUP_CRON0 0 2 1 * ?Monthly, 1st at 02:00.
ALFRESCO_TRACKER_BACKUP_LOCATION/backup/solrMust be a dedicated volume on the Solr container, listed in solr.allowPaths.
ALFRESCO_TRACKER_BACKUP_NUMBER_TO_KEEP2Full copies retained.
⁠TLS on the admin port
VariableDefaultPurpose
TRACKER_SERVER_SSL_ENABLEDfalseServes :8085 over TLS, client auth required.
TRACKER_SERVER_SSL_KEY_STORE / _PASSWORD—PKCS12 keystore.
TRACKER_SERVER_SSL_TRUST_STORE / _PASSWORD—PKCS12 truststore.

⁠Endpoints

PathPurpose
/actuator/healthLiveness and repository reachability. Used by the image HEALTHCHECK.
/actuator/infoBuild information.
/actuator/prometheusMetrics.
/actuator/repairreportPending indexing errors, recent repairs, per-category summary.
/api/admin/{action}Admin actions, REST form.
/solr/admin/cores?action={ACTION}Admin actions, Solr-compatible form.
/api/v1Service version and advertised capabilities. A 404 means a service older than the API.
/api/v1/index/node?ref=<dbid|uuid|noderef>Indexing verdict for one node: indexed, stale, error, orphan, unindexed, unverified or absent.
/api/v1/progress, /api/v1/progress/streamIndexing progress, as a snapshot or a Server-Sent Events stream (throughput, ETA).
/indexing.htmlStandalone page rendering that stream.

⁠Wiring the Alfresco repository

For Alfresco itself to reach these admin endpoints, install fr.pristy:pristy-search-subsystem-solr9 in the repository's WEB-INF/lib and start it with:

-Dindex.subsystem.name=solr9
-Dsolr.host=solr             -Dsolr.port=8983
-Dsolr.tracker.host=trackers -Dsolr.tracker.port=8085

solr.tracker.host must be set: it defaults to localhost, and every admin call then fails with Connection refused. Queries and the health ping keep going to Solr; only the admin actions go to this service.

⁠Runtime facts

  • Exposed port: 8085
  • Runs as user trackers, uid/gid 33007
  • Base image: eclipse-temurin:17-jre-alpine
  • Built-in HEALTHCHECK on /actuator/health
  • /opt/solr/data/alfrescoModels holds the synced content models — mount a volume to avoid re-syncing them on every restart

⁠Known limitations

  • Sharding is not implemented. No index-time routing survives the tracker externalization; shard.method in solrcore.properties is inert. Distributed queries still work.
  • FINGERPRINT search is not indexed. The MINHASH field is no longer computed at index time, so similarity search returns nothing.

Since 1.1.0, a node the repository reports as unindexable leaves an error document and surfaces in REPORT, /actuator/repairreport and retry, instead of being skipped with a WARN. A Solr outage on the write path no longer loses nodes either: the batch is rolled back and tracked again.

⁠Documentation

⁠License

LGPL v3 or later. Alfresco-derived sources keep their original Alfresco copyright and LGPL v3 headers.

Issues and merge requests: https://gitlab.com/pristy-oss/pristy-search-services⁠

Tag summary

Content type

Image

Digest

sha256:7d70e3466…

Size

179 MB

Last updated

6 days ago

docker pull jeci/pristy-indexing-trackers