Skip to content

Instantly share code, notes, and snippets.

View rxhl's full-sized avatar
❄️
Handmade Heaven

Rahul Sharma rxhl

❄️
Handmade Heaven
View GitHub Profile
GET recipes/default/_search
{
"query": {
"multi_match": {
"query": "Apple Airpods",
"fields": ["brand", "item"]
}
}
}
GET apple/default/_search
{
"query": {
"match": {
"item": "airpods"
}
}
}
GET apple/default/_search
{
"query": {
"wildcard": {
"item": "air*"
}
}
}
GET apple/default/_search
{
"query": {
"range": {
"price": {
"gte": 100,
"lte": 1000
}
}
}
GET apple/default/_search
{
"query": {
"terms": {
"item": [
"iphone",
"airpods"
]
}
}
GET apple/default/_search
{
"query": {
"term": {
"item": "airpods"
}
}
}
PUT apple
{
"mappings": {
"default": {
"dynamic": false,
"properties": {
"price": {
"type": "integer"
}
}
{
"brand": "Apple"
"item": "Airpods",
"capacity": null,
"price": "159.99",
"description": "Now with more talk time, voice-activated Siri access — and a new wireless charging case — AirPods deliver an unparalleled wireless headphone experience. Simply take them out and they're ready to use with all your devices. Put them in your ears and they connect immediately, immersing you in rich, high-quality sound."
}
GET apple/default/_search
{
"query": {
"match": {
"item": "airpods"
}
}
}
curl -k -H "Content-Type: application/json" -XPOST --user <username>:<password> "https://<your_elastic_instance_url>:<PORT>/apple/default/_bulk?pretty" --data-binary "@apple.json"