This file contains 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
GET / | |
PUT starwars | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"my_analyzer": { | |
"char_filter": [ | |
"html_strip" |
This file contains 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
ollama run llama3.2:1b | |
curl http://localhost:11434/v1/models --silent | jq | |
curl http://localhost:11434/v1/embeddings --silent --json '{ "model": "llama3.2:1b", "input": ["You Know, for Search"] }' | jq | |
curl -fsSL https://elastic.co/start-local | sh |
This file contains 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
PUT audio | |
{ | |
"mappings": { | |
"properties": { | |
"my_long_content": { | |
"type": "nested", //because there can be multiple vectors per doc | |
"properties": { | |
"vector": { | |
"type": "dense_vector" //the vector used for ranking | |
}, |
This file contains 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
GET / | |
DELETE starwars | |
DELETE semantic-starwars | |
PUT starwars | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { |
This file contains 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
DELETE my-long-text-index | |
PUT my-long-text-index | |
{ | |
"mappings": { | |
"properties": { | |
"my_long_text_field": { | |
"type": "nested", //because there can be multiple vectors per doc | |
"properties": { | |
"vector": { |
This file contains 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
See https://xeraa.net/talks/elasticsearch-piped-query-language-esql/ for an updated version :) |
This file contains 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
GET bytes-discuss-dense-search/_search | |
{ | |
"query": { | |
"multi_match": { | |
"fields": [ "title" ], | |
"query": "I don't know how to use ingest pipelines" | |
} | |
}, | |
"size": 6, | |
"fields": [ "title" ], |
This file contains 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
// Start the first node and keep the generated security credentials handy | |
docker run -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0 | |
// Check if the node has started correctly | |
curl --insecure --user elastic https://localhost:9200/ | |
// Add your second node | |
docker run -e ENROLLMENT_TOKEN="..." -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0 | |
// Check if it has joined the cluster |
This file contains 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
PUT jobs | |
{ | |
"mappings": { | |
"properties": { | |
"title": { | |
"type": "search_as_you_type" | |
} | |
} | |
} | |
} |
This file contains 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
PUT test/_doc/1 | |
{ | |
"test A": "a", | |
"test B": "b" | |
} | |
GET test/_search | |
{ | |
"query": { | |
"match": { | |
"test A": "a" |
NewerOlder