learn-searchcraft/create-schema.sh
2025-11-22 19:58:34 -06:00

126 lines
2.2 KiB
Bash

curl -X POST -H "Content-Type: application/json" --data '
{
"index": {
"name": "waylonwalker.com",
"search_fields": [
"title",
"body",
"tags",
"url"
],
"fields": {
"id": {
"type": "text",
"required": true,
"stored": true,
"indexed": false
},
"created_at": {
"type": "datetime",
"fast": true,
"stored": true,
"indexed": true
},
"title": {
"type": "text",
"stored": true
},
"body": {
"type": "text",
"stored": true
},
"active": {
"type": "bool",
"fast": true,
"stored": true
},
"rating": {
"type": "f64",
"stored": true,
"fast": true
},
"reviews": {
"type": "u64",
"stored": true,
"fast": true
},
"tags": {
"type": "text",
"stored": true,
"multi": true
},
"category": {
"type": "facet",
"stored": true
},
"formats": {
"type": "facet",
"stored": true,
"multi": true
},
"url": {
"type": "text",
"stored": true
}
},
"weight_multipliers": {
"title": 2,
"body": 0.7
}
}
}
' http://0.0.0.0:8000/index
curl -X POST -H "Content-Type: application/json" --data '
{
"index": {
"name": "thoughts-links",
"search_fields": [
"title",
"body",
"url"
],
"fields": {
"id": {
"type": "text",
"required": true,
"stored": true,
"indexed": false
},
"created_at": {
"type": "datetime",
"fast": true,
"stored": true,
"indexed": true
},
"title": {
"type": "text",
"stored": true
},
"body": {
"type": "text",
"stored": true
},
"description": {
"type": "text",
"stored": true
},
"image": {
"type": "text",
"stored": true
},
"url": {
"type": "text",
"stored": true
}
},
"weight_multipliers": {
"title": 2,
"body": 0.7,
"description": 0.7
}
}
}
' http://0.0.0.0:8000/index