# Movies

# One index

This is the simplest example. After a few steps you get API and access to UI dashboard to movies search engine

# Create server

docker pull itemsapi/itemsapi:latest
docker run --privileged -it -p 3000:3000 itemsapi/itemsapi

# Create configuration

curl https://raw.githubusercontent.com/itemsapi/itemsapi/2.0-branch/examples/configuration-movies.json -o configuration.json

curl -i -X POST 'http://127.0.0.1:3000/index1/configuration' \
  --header 'content-type: application/json' \
  --data-binary @./configuration.json

# Index data

curl https://raw.githubusercontent.com/itemsapi/itemsapi-example-data/master/items/imdb.json -o movies.json

curl -i -X POST 'http://127.0.0.1:3000/index1/index' \
  --header 'content-type: text/plain' \
  --data-binary @movies.json
curl -i -XPOST 'http://127.0.0.1:3000/index1/search' --header 'content-type: application/json'  -d '{"filters":{"tags": ["police"], "country": ["USA"]}}'
curl -i -XPOST 'http://127.0.0.1:3000/index1/search' --header 'content-type: application/json'  -d '{"filters":{"tags": [], "country": []}}'
curl -i -XPOST 'http://127.0.0.1:3000/index1/search' --header 'content-type: application/json'
curl -i -XGET 'http://127.0.0.1:3000/index1/search?page=1&per_page=30' --header 'content-type: application/json'

# Multi tenancy

Each index can have a different configuration and data

# First index

curl -i -X POST 'http://127.0.0.1:3000/index1/configuration' \
  --header 'content-type: application/json' \
  --data-binary @./configuration.json

curl -i -X POST 'http://127.0.0.1:3000/index1/index' \
  --header 'content-type: text/plain' \
  --data-binary @movies.json

# Second index

curl -i -X POST 'http://127.0.0.1:3000/index2/configuration' \
  --header 'content-type: application/json' \
  --data-binary @./configuration.json

curl -i -X POST 'http://127.0.0.1:3000/index2/index' \
  --header 'content-type: text/plain' \
  --data-binary @movies.json

# Dashboard

The movies indices can be accessed by a dashboard on http://localhost:3000/dashboard

Amazon movies