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 .

Last updated