mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 15:47:23 -04:00
663 lines
31 KiB
Text
663 lines
31 KiB
Text
// tag::cohere[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET cohere-embeddings/_search
|
||
{
|
||
"knn": {
|
||
"field": "content_embedding",
|
||
"query_vector_builder": {
|
||
"text_embedding": {
|
||
"model_id": "cohere_embeddings",
|
||
"model_text": "Muscles in human body"
|
||
}
|
||
},
|
||
"k": 10,
|
||
"num_candidates": 100
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `cohere-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,consol-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "cohere-embeddings",
|
||
"_id": "-eFWCY4BECzWLnMZuI78",
|
||
"_score": 0.737484,
|
||
"_source": {
|
||
"id": 1690948,
|
||
"content": "Oxygen is supplied to the muscles via red blood cells. Red blood cells carry hemoglobin which oxygen bonds with as the hemoglobin rich blood cells pass through the blood vessels of the lungs.The now oxygen rich blood cells carry that oxygen to the cells that are demanding it, in this case skeletal muscle cells.ther ways in which muscles are supplied with oxygen include: 1 Blood flow from the heart is increased. 2 Blood flow to your muscles in increased. 3 Blood flow from nonessential organs is transported to working muscles."
|
||
}
|
||
},
|
||
{
|
||
"_index": "cohere-embeddings",
|
||
"_id": "HuFWCY4BECzWLnMZuI_8",
|
||
"_score": 0.7176013,
|
||
"_source": {
|
||
"id": 1692482,
|
||
"content": "The thoracic cavity is separated from the abdominal cavity by the diaphragm. This is a broad flat muscle. (muscular) diaphragm The diaphragm is a muscle that separat…e the thoracic from the abdominal cavity. The pelvis is the lowest part of the abdominal cavity and it has no physical separation from it Diaphragm."
|
||
}
|
||
},
|
||
{
|
||
"_index": "cohere-embeddings",
|
||
"_id": "IOFWCY4BECzWLnMZuI_8",
|
||
"_score": 0.7154432,
|
||
"_source": {
|
||
"id": 1692489,
|
||
"content": "Muscular Wall Separating the Abdominal and Thoracic Cavities; Thoracic Cavity of a Fetal Pig; In Mammals the Diaphragm Separates the Abdominal Cavity from the"
|
||
}
|
||
},
|
||
{
|
||
"_index": "cohere-embeddings",
|
||
"_id": "C-FWCY4BECzWLnMZuI_8",
|
||
"_score": 0.695313,
|
||
"_source": {
|
||
"id": 1691493,
|
||
"content": "Burning, aching, tenderness and stiffness are just some descriptors of the discomfort you may feel in the muscles you exercised one to two days ago.For the most part, these sensations you experience after exercise are collectively known as delayed onset muscle soreness.urning, aching, tenderness and stiffness are just some descriptors of the discomfort you may feel in the muscles you exercised one to two days ago."
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::cohere[]
|
||
|
||
// tag::elser[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET elser-embeddings/_search
|
||
{
|
||
"query":{
|
||
"sparse_vector":{
|
||
"field": "content_embedding",
|
||
"inference_id": "elser_embeddings",
|
||
"query": "How to avoid muscle soreness after running?"
|
||
}
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `cohere-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,consol-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "elser-embeddings",
|
||
"_id": "ZLGc_pABZbBmsu5_eCoH",
|
||
"_score": 21.472063,
|
||
"_source": {
|
||
"id": 2258240,
|
||
"content": "You may notice some muscle aches while you are exercising. This is called acute soreness. More often, you may begin to feel sore about 12 hours after exercising, and the discomfort usually peaks at 48 to 72 hours after exercise. This is called delayed-onset muscle soreness.It is thought that, during this time, your body is repairing the muscle, making it stronger and bigger.You may also notice the muscles feel better if you exercise lightly. This is normal.his is called delayed-onset muscle soreness. It is thought that, during this time, your body is repairing the muscle, making it stronger and bigger. You may also notice the muscles feel better if you exercise lightly. This is normal."
|
||
}
|
||
},
|
||
{
|
||
"_index": "elser-embeddings",
|
||
"_id": "ZbGc_pABZbBmsu5_eCoH",
|
||
"_score": 21.421381,
|
||
"_source": {
|
||
"id": 2258242,
|
||
"content": "Photo Credit Jupiterimages/Stockbyte/Getty Images. That stiff, achy feeling you get in the days after exercise is a normal physiological response known as delayed onset muscle soreness. You can take it as a positive sign that your muscles have felt the workout, but the pain may also turn you off to further exercise.ou are more likely to develop delayed onset muscle soreness if you are new to working out, if you’ve gone a long time without exercising and start up again, if you have picked up a new type of physical activity or if you have recently boosted the intensity, length or frequency of your exercise sessions."
|
||
}
|
||
},
|
||
{
|
||
"_index": "elser-embeddings",
|
||
"_id": "ZrGc_pABZbBmsu5_eCoH",
|
||
"_score": 20.542095,
|
||
"_source": {
|
||
"id": 2258248,
|
||
"content": "They found that stretching before and after exercise has no effect on muscle soreness. Exercise might cause inflammation, which leads to an increase in the production of immune cells (comprised mostly of macrophages and neutrophils). Levels of these immune cells reach a peak 24-48 hours after exercise.These cells, in turn, produce bradykinins and prostaglandins, which make the pain receptors in your body more sensitive. Whenever you move, these pain receptors are stimulated.hey found that stretching before and after exercise has no effect on muscle soreness. Exercise might cause inflammation, which leads to an increase in the production of immune cells (comprised mostly of macrophages and neutrophils). Levels of these immune cells reach a peak 24-48 hours after exercise."
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::elser[]
|
||
|
||
// tag::hugging-face[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET hugging-face-embeddings/_search
|
||
{
|
||
"knn": {
|
||
"field": "content_embedding",
|
||
"query_vector_builder": {
|
||
"text_embedding": {
|
||
"model_id": "hugging_face_embeddings",
|
||
"model_text": "What's margin of error?"
|
||
}
|
||
},
|
||
"k": 10,
|
||
"num_candidates": 100
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `hugging-face-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,consol-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "hugging-face-embeddings",
|
||
"_id": "ljEfo44BiUQvMpPgT20E",
|
||
"_score": 0.8522128,
|
||
"_source": {
|
||
"id": 7960255,
|
||
"content": "The margin of error can be defined by either of the following equations. Margin of error = Critical value x Standard deviation of the statistic. Margin of error = Critical value x Standard error of the statistic. If you know the standard deviation of the statistic, use the first equation to compute the margin of error. Otherwise, use the second equation. Previously, we described how to compute the standard deviation and standard error."
|
||
}
|
||
},
|
||
{
|
||
"_index": "hugging-face-embeddings",
|
||
"_id": "lzEfo44BiUQvMpPgT20E",
|
||
"_score": 0.7865497,
|
||
"_source": {
|
||
"id": 7960259,
|
||
"content": "1 y ou are told only the size of the sample and are asked to provide the margin of error for percentages which are not (yet) known. 2 This is typically the case when you are computing the margin of error for a survey which is going to be conducted in the future."
|
||
}
|
||
},
|
||
{
|
||
"_index": "hugging-face-embeddings1",
|
||
"_id": "DjEfo44BiUQvMpPgT20E",
|
||
"_score": 0.6229427,
|
||
"_source": {
|
||
"id": 2166183,
|
||
"content": "1. In general, the point at which gains equal losses. 2. In options, the market price that a stock must reach for option buyers to avoid a loss if they exercise. For a call, it is the strike price plus the premium paid. For a put, it is the strike price minus the premium paid."
|
||
}
|
||
},
|
||
{
|
||
"_index": "hugging-face-embeddings1",
|
||
"_id": "VzEfo44BiUQvMpPgT20E",
|
||
"_score": 0.6034223,
|
||
"_source": {
|
||
"id": 2173417,
|
||
"content": "How do you find the area of a circle? Can you measure the area of a circle and use that to find a value for Pi?"
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::hugging-face[]
|
||
|
||
// tag::openai[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET openai-embeddings/_search
|
||
{
|
||
"knn": {
|
||
"field": "content_embedding",
|
||
"query_vector_builder": {
|
||
"text_embedding": {
|
||
"model_id": "openai_embeddings",
|
||
"model_text": "Calculate fuel cost"
|
||
}
|
||
},
|
||
"k": 10,
|
||
"num_candidates": 100
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `openai-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,consol-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "openai-embeddings",
|
||
"_id": "DDd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.83704096,
|
||
"_source": {
|
||
"id": 862114,
|
||
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
|
||
}
|
||
},
|
||
{
|
||
"_index": "openai-embeddings",
|
||
"_id": "ajd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8345704,
|
||
"_source": {
|
||
"id": 820622,
|
||
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
|
||
}
|
||
},
|
||
{
|
||
"_index": "openai-embeddings",
|
||
"_id": "Djd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8327426,
|
||
"_source": {
|
||
"id": 8202683,
|
||
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::openai[]
|
||
|
||
// tag::azure-openai[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET azure-openai-embeddings/_search
|
||
{
|
||
"knn": {
|
||
"field": "content_embedding",
|
||
"query_vector_builder": {
|
||
"text_embedding": {
|
||
"model_id": "azure_openai_embeddings",
|
||
"model_text": "Calculate fuel cost"
|
||
}
|
||
},
|
||
"k": 10,
|
||
"num_candidates": 100
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `azure-openai-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,consol-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "azure-openai-embeddings",
|
||
"_id": "DDd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.83704096,
|
||
"_source": {
|
||
"id": 862114,
|
||
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
|
||
}
|
||
},
|
||
{
|
||
"_index": "azure-openai-embeddings",
|
||
"_id": "ajd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8345704,
|
||
"_source": {
|
||
"id": 820622,
|
||
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
|
||
}
|
||
},
|
||
{
|
||
"_index": "azure-openai-embeddings",
|
||
"_id": "Djd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8327426,
|
||
"_source": {
|
||
"id": 8202683,
|
||
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::azure-openai[]
|
||
|
||
// tag::azure-ai-studio[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET azure-ai-studio-embeddings/_search
|
||
{
|
||
"knn": {
|
||
"field": "content_embedding",
|
||
"query_vector_builder": {
|
||
"text_embedding": {
|
||
"model_id": "azure_ai_studio_embeddings",
|
||
"model_text": "Calculate fuel cost"
|
||
}
|
||
},
|
||
"k": 10,
|
||
"num_candidates": 100
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `azure-ai-studio-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,consol-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "azure-ai-studio-embeddings",
|
||
"_id": "DDd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.83704096,
|
||
"_source": {
|
||
"id": 862114,
|
||
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
|
||
}
|
||
},
|
||
{
|
||
"_index": "azure-ai-studio-embeddings",
|
||
"_id": "ajd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8345704,
|
||
"_source": {
|
||
"id": 820622,
|
||
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
|
||
}
|
||
},
|
||
{
|
||
"_index": "azure-ai-studio-embeddings",
|
||
"_id": "Djd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8327426,
|
||
"_source": {
|
||
"id": 8202683,
|
||
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::azure-ai-studio[]
|
||
|
||
// tag::google-vertex-ai[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET google-vertex-ai-embeddings/_search
|
||
{
|
||
"knn": {
|
||
"field": "content_embedding",
|
||
"query_vector_builder": {
|
||
"text_embedding": {
|
||
"model_id": "google_vertex_ai_embeddings",
|
||
"model_text": "Calculate fuel cost"
|
||
}
|
||
},
|
||
"k": 10,
|
||
"num_candidates": 100
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `mistral-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,console-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "google-vertex-ai-embeddings",
|
||
"_id": "Ryv0nZEBBFPLbFsdCbGn",
|
||
"_score": 0.86815524,
|
||
"_source": {
|
||
"id": 3041038,
|
||
"content": "For example, the cost of the fuel could be 96.9, the amount could be 10 pounds, and the distance covered could be 80 miles. To convert between Litres per 100KM and Miles Per Gallon, please provide a value and click on the required button.o calculate how much fuel you'll need for a given journey, please provide the distance in miles you will be covering on your journey, and the estimated MPG of your vehicle. To work out what MPG you are really getting, please provide the cost of the fuel, how much you spent on the fuel, and how far it took you."
|
||
}
|
||
},
|
||
{
|
||
"_index": "google-vertex-ai-embeddings",
|
||
"_id": "w4j0nZEBZ1nFq1oiHQvK",
|
||
"_score": 0.8676357,
|
||
"_source": {
|
||
"id": 1541469,
|
||
"content": "This driving cost calculator takes into consideration the fuel economy of the vehicle that you are travelling in as well as the fuel cost. This road trip gas calculator will give you an idea of how much would it cost to drive before you actually travel.his driving cost calculator takes into consideration the fuel economy of the vehicle that you are travelling in as well as the fuel cost. This road trip gas calculator will give you an idea of how much would it cost to drive before you actually travel."
|
||
}
|
||
},
|
||
{
|
||
"_index": "google-vertex-ai-embeddings",
|
||
"_id": "Hoj0nZEBZ1nFq1oiHQjJ",
|
||
"_score": 0.80510974,
|
||
"_source": {
|
||
"id": 7982559,
|
||
"content": "What's that light cost you? 1 Select your electric rate (or click to enter your own). 2 You can calculate results for up to four types of lights. 3 Select the type of lamp (i.e. 4 Select the lamp wattage (lamp lumens). 5 Enter the number of lights in use. 6 Select how long the lamps are in use (or click to enter your own; enter hours on per year). 7 Finally, ..."
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::google-vertex-ai[]
|
||
|
||
// tag::mistral[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET mistral-embeddings/_search
|
||
{
|
||
"knn": {
|
||
"field": "content_embedding",
|
||
"query_vector_builder": {
|
||
"text_embedding": {
|
||
"model_id": "mistral_embeddings",
|
||
"model_text": "Calculate fuel cost"
|
||
}
|
||
},
|
||
"k": 10,
|
||
"num_candidates": 100
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `mistral-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,consol-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "mistral-embeddings",
|
||
"_id": "DDd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.83704096,
|
||
"_source": {
|
||
"id": 862114,
|
||
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
|
||
}
|
||
},
|
||
{
|
||
"_index": "mistral-embeddings",
|
||
"_id": "ajd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8345704,
|
||
"_source": {
|
||
"id": 820622,
|
||
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
|
||
}
|
||
},
|
||
{
|
||
"_index": "mistral-embeddings",
|
||
"_id": "Djd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8327426,
|
||
"_source": {
|
||
"id": 8202683,
|
||
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::mistral[]
|
||
|
||
// tag::amazon-bedrock[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET amazon-bedrock-embeddings/_search
|
||
{
|
||
"knn": {
|
||
"field": "content_embedding",
|
||
"query_vector_builder": {
|
||
"text_embedding": {
|
||
"model_id": "amazon_bedrock_embeddings",
|
||
"model_text": "Calculate fuel cost"
|
||
}
|
||
},
|
||
"k": 10,
|
||
"num_candidates": 100
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `amazon-bedrock-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,consol-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "amazon-bedrock-embeddings",
|
||
"_id": "DDd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.83704096,
|
||
"_source": {
|
||
"id": 862114,
|
||
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
|
||
}
|
||
},
|
||
{
|
||
"_index": "amazon-bedrock-embeddings",
|
||
"_id": "ajd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8345704,
|
||
"_source": {
|
||
"id": 820622,
|
||
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
|
||
}
|
||
},
|
||
{
|
||
"_index": "amazon-bedrock-embeddings",
|
||
"_id": "Djd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8327426,
|
||
"_source": {
|
||
"id": 8202683,
|
||
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::amazon-bedrock[]
|
||
|
||
// tag::alibabacloud-ai-search[]
|
||
|
||
[source,console]
|
||
--------------------------------------------------
|
||
GET alibabacloud-ai-search-embeddings/_search
|
||
{
|
||
"knn": {
|
||
"field": "content_embedding",
|
||
"query_vector_builder": {
|
||
"text_embedding": {
|
||
"model_id": "alibabacloud_ai_search_embeddings",
|
||
"model_text": "Calculate fuel cost"
|
||
}
|
||
},
|
||
"k": 10,
|
||
"num_candidates": 100
|
||
},
|
||
"_source": [
|
||
"id",
|
||
"content"
|
||
]
|
||
}
|
||
--------------------------------------------------
|
||
// TEST[skip:TBD]
|
||
|
||
As a result, you receive the top 10 documents that are closest in meaning to the
|
||
query from the `alibabacloud-ai-search-embeddings` index sorted by their proximity to the query:
|
||
|
||
[source,consol-result]
|
||
--------------------------------------------------
|
||
"hits": [
|
||
{
|
||
"_index": "alibabacloud-ai-search-embeddings",
|
||
"_id": "DDd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.83704096,
|
||
"_source": {
|
||
"id": 862114,
|
||
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
|
||
}
|
||
},
|
||
{
|
||
"_index": "alibabacloud-ai-search-embeddings",
|
||
"_id": "ajd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8345704,
|
||
"_source": {
|
||
"id": 820622,
|
||
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
|
||
}
|
||
},
|
||
{
|
||
"_index": "alibabacloud-ai-search-embeddings",
|
||
"_id": "Djd5OowBHxQKHyc3TDSC",
|
||
"_score": 0.8327426,
|
||
"_source": {
|
||
"id": 8202683,
|
||
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
|
||
}
|
||
},
|
||
(...)
|
||
]
|
||
--------------------------------------------------
|
||
// NOTCONSOLE
|
||
|
||
// end::alibabacloud-ai-search[]
|