Created
October 19, 2021 07:07
-
-
Save VerosK/be8db9a71b9fd59f8a710fc010759f70 to your computer and use it in GitHub Desktop.
JSON - demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name" : "John", | |
"lastname" : "Smith", | |
"job_description" : "Accountant" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name" : "John", | |
"lastname" : "Doe", | |
"job_description" : "Systems administrator and Linux specialist" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# legacy | |
#curl -XPOST localhost:9200/people/person/1 -H "Content-Type: application/json" --data-binary '@john.json' | |
curl -XPUT localhost:9200/people/_doc/1 -H "Content-Type: application/json" --data-binary '@john.json' | |
# legacy | |
#curl -XPOST localhost:9200/people/person/ -H "Content-Type: application/json" --data-binary '@john-smith.json' | |
curl -XPOST localhost:9200/people/_doc/ -H "Content-Type: application/json" --data-binary '@john-smith.json' | |
# legacy | |
# curl -XGET localhost:9200/people/person/ | |
curl -XGET localhost:9200/people/_doc/1 | |
# check it exists | |
curl -XHEAD localhost:9200/people/_doc/1 | |
# check only source data | |
curl -XGET localhost:9200/people/_source/1 | |
# _search - Lucene QL | |
curl -XGET localhost:9200/people/_search?q=john | |
# _search - Lucene QL | |
curl -XGET localhost:9200/people/_search?q=job_description:john |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment