Open Content
Docs homeNaviga web
  • Introduction
  • Overview
  • Key features
  • Meta data standards
  • Architecture
  • Open Content API
  • Headless and end-to-end CMS workflows
  • Use and explore
    • How does it work
    • Open Content Docker
    • OC REST API
    • Event logs
    • Replication
    • Open Content Notifier
    • New JSON API:s - CCA and Duppy
    • Terminology: Other backend services
    • Lab: upload
      • Curl for object upload
      • Environment
      • Lab 0: Configuration
      • Lab 1: Concept upload
      • Lab 2: Image upload
      • Lab 3: Article Upload
      • Lab 4: Search
      • Lab 5: Delete objects
      • Lab 6: Event sourcing using event log
  • Releases
    • Release documentation and admin guides
      • Open Content 2.3
    • New in OC 3.0 (draft)
      • Removed features in OC 3.0
  • XLibris Archive
    • Archive everything you ever created or published
    • Import content to XLibris
Powered by GitBook
On this page
  • To perform a simple search without any arguments :
  • Get only the uuid property for each hit
  • Get only Articles and the uuid
  • Get Articles and the concept names
  • Get Articles and only Weekend Concept
Export as PDF
  1. Use and explore
  2. Lab: upload

Lab 4: Search

Learn how to perform search towards Open Content /search/ endpoint

A small tool for Open Content API test can be used for easier learning of Open Content search API. The UI can be accessed from the url http://localhost:8800 when Open Content docker-compose is started. T

This tool purpose is to make it easier to design search questions towards Open Content. It is not used in production environments.

The configuration in these exercises uses nested properties and assumes that you have the content from lab 1-3 uploaded.

To perform a simple search without any arguments :

curl -s -u admin:admin "http://localhost:8080/opencontent/search?" | jq .

Get only the uuid property for each hit

curl -s -u admin:admin "http://localhost:8080/opencontent/search?\
properties=uuid" | jq .

Get only Articles and the uuid

curl -s -u admin:admin "http://localhost:8080/opencontent/search?\
q=contenttype:Article&\
properties=uuid"

Get Articles and the concept names

curl --globoff -s -u admin:admin "http://localhost:8080/opencontent/search?\
q=contenttype:Article&\
properties=uuid,ConceptRelations[ConceptName]" | jq .

Get Articles and only Weekend Concept

curl -s --globoff -u admin:admin "http://localhost:8080/opencontent/search?\
q=contenttype:Article&\
properties=uuid,ConceptRelations[ConceptName]&\
filters=ConceptRelations(q=ConceptName:Weekend)" | jq .
PreviousLab 3: Article UploadNextLab 5: Delete objects

Last updated 5 years ago