Belajar Peringkat untuk OpenSearch Layanan Amazon - OpenSearch Layanan Amazon

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Belajar Peringkat untuk OpenSearch Layanan Amazon

OpenSearch menggunakan kerangka peringkat probabilistik yang disebut BM-25 untuk menghitung skor relevansi. Jika kata kunci khas muncul lebih sering dalam dokumen, BM-25 memberikan skor relevansi yang lebih tinggi untuk dokumen tersebut. Akan tetapi, kerangka kerja ini tidak memperhitungkan perilaku pengguna akun seperti data klik-tayang, yang dapat lebih meningkatkan relevansi.

Learning to Rank adalah plugin open-source yang memungkinkan Anda menggunakan pembelajaran mesin dan data perilaku untuk menyesuaikan relevansi dokumen. Ini menggunakan model dari perpustakaan XGBoost dan Ranklib untuk mencetak ulang hasil pencarian. Plugin Elasticsearch LTR awalnya dikembangkan oleh OpenSource Connections, dengan kontribusi signifikan oleh Wikimedia Foundation, Snagajob Engineering, Bonsai, dan Yelp Engineering. OpenSearch Versi plugin berasal dari plugin Elasticsearch LTR. Dokumentasi lengkap, termasuk langkah-langkah rinci dan deskripsi API, tersedia dalam dokumentasi Learning to Rank.

Belajar Peringkat membutuhkan OpenSearch atau Elasticsearch 7.7 atau yang lebih baru.

catatan

Untuk menggunakan plugin Learning to Rank, Anda harus memiliki izin admin lengkap. Untuk mempelajari selengkapnya, lihat Mengubah pengguna utama.

Memulai dengan Learning to Rank

Anda perlu memberikan daftar penilaian, menyiapkan kumpulan data pelatihan, dan melatih model di luar OpenSearch Layanan Amazon. Bagian berwarna biru terjadi di luar OpenSearch Layanan:


        Contoh Proses Plugin Learning to Rank.

Langkah 1: Menginisialisasi plugin

Untuk menginisialisasi plugin Learning to Rank, kirim permintaan berikut ke domain OpenSearch Layanan Anda:

PUT _ltr
{ "acknowledged" : true, "shards_acknowledged" : true, "index" : ".ltrstore" }

Perintah ini membuat indeks .ltrstore tersembunyi yang menyimpan informasi metadata seperti set dan model fitur.

Langkah 2: Buat daftar penilaian

catatan

Anda harus melakukan langkah ini di luar OpenSearch Layanan.

Daftar penilaian adalah kumpulan contoh yang dipelajari oleh model machine learning. Daftar penilaian Anda harus mencakup kata kunci yang penting bagi Anda dan satu set dokumen yang telah dinilai untuk setiap kata kunci.

Dalam contoh ini, kita memiliki daftar penilaian untuk set data film. Nilai 4 menunjukkan kecocokan yang sempurna. Nilai 0 menunjukkan pertandingan terburuk.

Nilai Kata Kunci ID Dokumen Nama film
4 rambo 7555 Rambo
3 rambo 1370 Rambo III
3 rambo 1369 Rambo: First Blood Part II
3 rambo 1368 First Blood

Siapkan daftar penilaian Anda dalam format berikut:

4 qid:1 # 7555 Rambo 3 qid:1 # 1370 Rambo III 3 qid:1 # 1369 Rambo: First Blood Part II 3 qid:1 # 1368 First Blood where qid:1 represents "rambo"

Untuk contoh daftar penilaian yang lebih lengkap, lihat penilaian film.

Anda dapat membuat daftar penilaian ini secara manual dengan bantuan anotator manusia atau menyimpulkan secara terprogram dari data analitik.

Langkah 3: Bangun satu set fitur

Fitur adalah bidang yang sesuai dengan relevansi dokumen—misalnya, title, overview, popularity score (jumlah tampilan), dan sebagainya.

Bangun satu set fitur dengan template Mustache untuk setiap fitur. Untuk informasi selengkapnya tentang fitur, lihat Bekerja dengan Fitur.

Dalam contoh ini, kita membangun fitur movie_features yang ditetapkan dengan bidang title dan overview:

POST _ltr/_featureset/movie_features { "featureset" : { "name" : "movie_features", "features" : [ { "name" : "1", "params" : [ "keywords" ], "template_language" : "mustache", "template" : { "match" : { "title" : "{{keywords}}" } } }, { "name" : "2", "params" : [ "keywords" ], "template_language" : "mustache", "template" : { "match" : { "overview" : "{{keywords}}" } } } ] } }

Jika mengajukan kueri untuk indeks .ltrstore asli, Anda mendapatkan kembali set fitur Anda:

GET _ltr/_featureset

Langkah 4: Log nilai fitur

Nilai fitur adalah skor relevansi yang dihitung oleh BM-25 untuk setiap fitur.

Menggabungkan set fitur dan daftar penilaian untuk mencatat log nilai fitur. Untuk informasi selengkapnya tentang fitur pencatatan log, lihat Skor Fitur Pencatatan Log.

Dalam contoh ini, kueri bool mengambil dokumen yang sudah dinilai dengan filter, kemudian memilih set fitur dengan kueri sltr. Kueri ltr_log menggabungkan dokumen dan fitur untuk mencatat log nilai fitur yang sesuai:

POST tmdb/_search { "_source": { "includes": [ "title", "overview" ] }, "query": { "bool": { "filter": [ { "terms": { "_id": [ "7555", "1370", "1369", "1368" ] } }, { "sltr": { "_name": "logged_featureset", "featureset": "movie_features", "params": { "keywords": "rambo" } } } ] } }, "ext": { "ltr_log": { "log_specs": { "name": "log_entry1", "named_query": "logged_featureset" } } } }

Respons sampel mungkin terlihat seperti berikut ini:

{ "took" : 7, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 4, "relation" : "eq" }, "max_score" : 0.0, "hits" : [ { "_index" : "tmdb", "_type" : "movie", "_id" : "1368", "_score" : 0.0, "_source" : { "overview" : "When former Green Beret John Rambo is harassed by local law enforcement and arrested for vagrancy, the Vietnam vet snaps, runs for the hills and rat-a-tat-tats his way into the action-movie hall of fame. Hounded by a relentless sheriff, Rambo employs heavy-handed guerilla tactics to shake the cops off his tail.", "title" : "First Blood" }, "fields" : { "_ltrlog" : [ { "log_entry1" : [ { "name" : "1" }, { "name" : "2", "value" : 10.558305 } ] } ] }, "matched_queries" : [ "logged_featureset" ] }, { "_index" : "tmdb", "_type" : "movie", "_id" : "7555", "_score" : 0.0, "_source" : { "overview" : "When governments fail to act on behalf of captive missionaries, ex-Green Beret John James Rambo sets aside his peaceful existence along the Salween River in a war-torn region of Thailand to take action. Although he's still haunted by violent memories of his time as a U.S. soldier during the Vietnam War, Rambo can hardly turn his back on the aid workers who so desperately need his help.", "title" : "Rambo" }, "fields" : { "_ltrlog" : [ { "log_entry1" : [ { "name" : "1", "value" : 11.2569065 }, { "name" : "2", "value" : 9.936821 } ] } ] }, "matched_queries" : [ "logged_featureset" ] }, { "_index" : "tmdb", "_type" : "movie", "_id" : "1369", "_score" : 0.0, "_source" : { "overview" : "Col. Troutman recruits ex-Green Beret John Rambo for a highly secret and dangerous mission. Teamed with Co Bao, Rambo goes deep into Vietnam to rescue POWs. Deserted by his own team, he's left in a hostile jungle to fight for his life, avenge the death of a woman and bring corrupt officials to justice.", "title" : "Rambo: First Blood Part II" }, "fields" : { "_ltrlog" : [ { "log_entry1" : [ { "name" : "1", "value" : 6.334839 }, { "name" : "2", "value" : 10.558305 } ] } ] }, "matched_queries" : [ "logged_featureset" ] }, { "_index" : "tmdb", "_type" : "movie", "_id" : "1370", "_score" : 0.0, "_source" : { "overview" : "Combat has taken its toll on Rambo, but he's finally begun to find inner peace in a monastery. When Rambo's friend and mentor Col. Trautman asks for his help on a top secret mission to Afghanistan, Rambo declines but must reconsider when Trautman is captured.", "title" : "Rambo III" }, "fields" : { "_ltrlog" : [ { "log_entry1" : [ { "name" : "1", "value" : 9.425955 }, { "name" : "2", "value" : 11.262714 } ] } ] }, "matched_queries" : [ "logged_featureset" ] } ] } }

Pada contoh sebelumnya, fitur pertama tidak memiliki nilai fitur karena kata kunci “rambo” tidak muncul di bidang judul dokumen dengan ID sama dengan 1368. Ini adalah nilai fitur yang hilang dalam data pelatihan.

Langkah 5: Buat set data pelatihan

catatan

Anda harus melakukan langkah ini di luar OpenSearch Layanan.

Langkah selanjutnya adalah menggabungkan daftar penilaian dan nilai fitur untuk membuat set data pelatihan. Jika daftar penilaian asli Anda terlihat seperti ini:

4 qid:1 # 7555 Rambo 3 qid:1 # 1370 Rambo III 3 qid:1 # 1369 Rambo: First Blood Part II 3 qid:1 # 1368 First Blood

Lakukan konversi ke dalam set data pelatihan akhir, yang terlihat seperti ini:

4 qid:1 1:12.318474 2:10.573917 # 7555 rambo 3 qid:1 1:10.357875 2:11.950391 # 1370 rambo 3 qid:1 1:7.010513 2:11.220095 # 1369 rambo 3 qid:1 1:0.0 2:11.220095 # 1368 rambo

Anda dapat melakukan langkah ini secara manual atau menulis program untuk mengotomatisasinya.

Langkah 6: Pilih algoritme dan membangun model

catatan

Anda harus melakukan langkah ini di luar OpenSearch Layanan.

Dengan set data pelatihan di tempat, langkah selanjutnya adalah menggunakan perpustakaan XGBoost atau Ranklib untuk membangun sebuah model. Perpustakaan XGBoost dan Ranklib memungkinkan Anda membangun model populer seperti LambdamArt, Random Forest, dan sebagainya.

Untuk langkah-langkah menggunakan XGBoost dan Ranklib untuk membangun model, lihat XGBoost dan dokumentasi, masing-masing. RankLib Untuk menggunakan Amazon SageMaker untuk membangun model XGBoost, lihat Algoritma XGBoost.

Langkah 7: Men-deploy model

Setelah Anda membuat model, deploy-kan model tersebut ke plugin Learning to Rank. Untuk informasi selengkapnya tentang proses deploy model, lihat Mengunggah Model Terlatih.

Dalam contoh ini, kami membangun model my_ranklib_model dengan menggunakan pustaka Ranklib:

POST _ltr/_featureset/movie_features/_createmodel?pretty { "model": { "name": "my_ranklib_model", "model": { "type": "model/ranklib", "definition": """## LambdaMART ## No. of trees = 10 ## No. of leaves = 10 ## No. of threshold candidates = 256 ## Learning rate = 0.1 ## Stop early = 100 <ensemble> <tree id="1" weight="0.1"> <split> <feature>1</feature> <threshold>10.357875</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-2.0</output> </split> <split pos="right"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <output>-2.0</output> </split> <split pos="right"> <output>-2.0</output> </split> </split> </split> <split pos="right"> <output>2.0</output> </split> </split> </tree> <tree id="2" weight="0.1"> <split> <feature>1</feature> <threshold>10.357875</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-1.67031991481781</output> </split> <split pos="right"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <output>-1.67031991481781</output> </split> <split pos="right"> <output>-1.6703200340270996</output> </split> </split> </split> <split pos="right"> <output>1.6703201532363892</output> </split> </split> </tree> <tree id="3" weight="0.1"> <split> <feature>2</feature> <threshold>10.573917</threshold> <split pos="left"> <output>1.479954481124878</output> </split> <split pos="right"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-1.4799546003341675</output> </split> <split pos="right"> <output>-1.479954481124878</output> </split> </split> <split pos="right"> <output>-1.479954481124878</output> </split> </split> </split> </tree> <tree id="4" weight="0.1"> <split> <feature>1</feature> <threshold>10.357875</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-1.3569872379302979</output> </split> <split pos="right"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <output>-1.3569872379302979</output> </split> <split pos="right"> <output>-1.3569872379302979</output> </split> </split> </split> <split pos="right"> <output>1.3569873571395874</output> </split> </split> </tree> <tree id="5" weight="0.1"> <split> <feature>1</feature> <threshold>10.357875</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-1.2721362113952637</output> </split> <split pos="right"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <output>-1.2721363306045532</output> </split> <split pos="right"> <output>-1.2721363306045532</output> </split> </split> </split> <split pos="right"> <output>1.2721362113952637</output> </split> </split> </tree> <tree id="6" weight="0.1"> <split> <feature>1</feature> <threshold>10.357875</threshold> <split pos="left"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-1.2110036611557007</output> </split> <split pos="right"> <output>-1.2110036611557007</output> </split> </split> <split pos="right"> <output>-1.2110037803649902</output> </split> </split> <split pos="right"> <output>1.2110037803649902</output> </split> </split> </tree> <tree id="7" weight="0.1"> <split> <feature>1</feature> <threshold>10.357875</threshold> <split pos="left"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-1.165616512298584</output> </split> <split pos="right"> <output>-1.165616512298584</output> </split> </split> <split pos="right"> <output>-1.165616512298584</output> </split> </split> <split pos="right"> <output>1.165616512298584</output> </split> </split> </tree> <tree id="8" weight="0.1"> <split> <feature>1</feature> <threshold>10.357875</threshold> <split pos="left"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-1.131177544593811</output> </split> <split pos="right"> <output>-1.131177544593811</output> </split> </split> <split pos="right"> <output>-1.131177544593811</output> </split> </split> <split pos="right"> <output>1.131177544593811</output> </split> </split> </tree> <tree id="9" weight="0.1"> <split> <feature>2</feature> <threshold>10.573917</threshold> <split pos="left"> <output>1.1046180725097656</output> </split> <split pos="right"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-1.1046180725097656</output> </split> <split pos="right"> <output>-1.1046180725097656</output> </split> </split> <split pos="right"> <output>-1.1046180725097656</output> </split> </split> </split> </tree> <tree id="10" weight="0.1"> <split> <feature>1</feature> <threshold>10.357875</threshold> <split pos="left"> <feature>1</feature> <threshold>7.010513</threshold> <split pos="left"> <feature>1</feature> <threshold>0.0</threshold> <split pos="left"> <output>-1.0838804244995117</output> </split> <split pos="right"> <output>-1.0838804244995117</output> </split> </split> <split pos="right"> <output>-1.0838804244995117</output> </split> </split> <split pos="right"> <output>1.0838804244995117</output> </split> </split> </tree> </ensemble> """ } } }

Untuk melihat model, kirim permintaan berikut:

GET _ltr/_model/my_ranklib_model

Langkah 8: Lakukan pencarian dengan pembelajaran untuk peringkat

Setelah men-deploy model, Anda siap untuk mencari.

Ajukan kueri sltr dengan fitur yang Anda gunakan dan nama model yang ingin Anda jalankan:

POST tmdb/_search { "_source": { "includes": ["title", "overview"] }, "query": { "multi_match": { "query": "rambo", "fields": ["title", "overview"] } }, "rescore": { "query": { "rescore_query": { "sltr": { "params": { "keywords": "rambo" }, "model": "my_ranklib_model" } } } } }

Dengan Learning to Rank, Anda melihat “Rambo” sebagai hasil pertama karena kita telah menetapkan nilai tertinggi dalam daftar penilaian:

{ "took" : 12, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 7, "relation" : "eq" }, "max_score" : 13.096414, "hits" : [ { "_index" : "tmdb", "_type" : "movie", "_id" : "7555", "_score" : 13.096414, "_source" : { "overview" : "When governments fail to act on behalf of captive missionaries, ex-Green Beret John James Rambo sets aside his peaceful existence along the Salween River in a war-torn region of Thailand to take action. Although he's still haunted by violent memories of his time as a U.S. soldier during the Vietnam War, Rambo can hardly turn his back on the aid workers who so desperately need his help.", "title" : "Rambo" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "1370", "_score" : 11.17245, "_source" : { "overview" : "Combat has taken its toll on Rambo, but he's finally begun to find inner peace in a monastery. When Rambo's friend and mentor Col. Trautman asks for his help on a top secret mission to Afghanistan, Rambo declines but must reconsider when Trautman is captured.", "title" : "Rambo III" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "1368", "_score" : 10.442155, "_source" : { "overview" : "When former Green Beret John Rambo is harassed by local law enforcement and arrested for vagrancy, the Vietnam vet snaps, runs for the hills and rat-a-tat-tats his way into the action-movie hall of fame. Hounded by a relentless sheriff, Rambo employs heavy-handed guerilla tactics to shake the cops off his tail.", "title" : "First Blood" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "1369", "_score" : 10.442155, "_source" : { "overview" : "Col. Troutman recruits ex-Green Beret John Rambo for a highly secret and dangerous mission. Teamed with Co Bao, Rambo goes deep into Vietnam to rescue POWs. Deserted by his own team, he's left in a hostile jungle to fight for his life, avenge the death of a woman and bring corrupt officials to justice.", "title" : "Rambo: First Blood Part II" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "31362", "_score" : 7.424202, "_source" : { "overview" : "It is 1985, and a small, tranquil Florida town is being rocked by a wave of vicious serial murders and bank robberies. Particularly sickening to the authorities is the gratuitous use of violence by two “Rambo” like killers who dress themselves in military garb. Based on actual events taken from FBI files, the movie depicts the Bureau’s efforts to track down these renegades.", "title" : "In the Line of Duty: The F.B.I. Murders" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "13258", "_score" : 6.43182, "_source" : { "overview" : """Will Proudfoot (Bill Milner) is looking for an escape from his family's stifling home life when he encounters Lee Carter (Will Poulter), the school bully. Armed with a video camera and a copy of "Rambo: First Blood", Lee plans to make cinematic history by filming his own action-packed video epic. Together, these two newfound friends-turned-budding-filmmakers quickly discover that their imaginative ― and sometimes mishap-filled ― cinematic adventure has begun to take on a life of its own!""", "title" : "Son of Rambow" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "61410", "_score" : 3.9719706, "_source" : { "overview" : "It's South Africa 1990. Two major events are about to happen: The release of Nelson Mandela and, more importantly, it's Spud Milton's first year at an elite boys only private boarding school. John Milton is a boy from an ordinary background who wins a scholarship to a private school in Kwazulu-Natal, South Africa. Surrounded by boys with nicknames like Gecko, Rambo, Rain Man and Mad Dog, Spud has his hands full trying to adapt to his new home. Along the way Spud takes his first tentative steps along the path to manhood. (The path it seems could be a rather long road). Spud is an only child. He is cursed with parents from well beyond the lunatic fringe and a senile granny. His dad is a fervent anti-communist who is paranoid that the family domestic worker is running a shebeen from her room at the back of the family home. His mom is a free spirit and a teenager's worst nightmare, whether it's shopping for Spud's underwear in the local supermarket", "title" : "Spud" } } ] } }

Jika Anda mencari tanpa menggunakan plugin Learning to Rank, OpenSearch mengembalikan hasil yang berbeda:

POST tmdb/_search { "_source": { "includes": ["title", "overview"] }, "query": { "multi_match": { "query": "Rambo", "fields": ["title", "overview"] } } }
{ "took" : 5, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 5, "relation" : "eq" }, "max_score" : 11.262714, "hits" : [ { "_index" : "tmdb", "_type" : "movie", "_id" : "1370", "_score" : 11.262714, "_source" : { "overview" : "Combat has taken its toll on Rambo, but he's finally begun to find inner peace in a monastery. When Rambo's friend and mentor Col. Trautman asks for his help on a top secret mission to Afghanistan, Rambo declines but must reconsider when Trautman is captured.", "title" : "Rambo III" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "7555", "_score" : 11.2569065, "_source" : { "overview" : "When governments fail to act on behalf of captive missionaries, ex-Green Beret John James Rambo sets aside his peaceful existence along the Salween River in a war-torn region of Thailand to take action. Although he's still haunted by violent memories of his time as a U.S. soldier during the Vietnam War, Rambo can hardly turn his back on the aid workers who so desperately need his help.", "title" : "Rambo" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "1368", "_score" : 10.558305, "_source" : { "overview" : "When former Green Beret John Rambo is harassed by local law enforcement and arrested for vagrancy, the Vietnam vet snaps, runs for the hills and rat-a-tat-tats his way into the action-movie hall of fame. Hounded by a relentless sheriff, Rambo employs heavy-handed guerilla tactics to shake the cops off his tail.", "title" : "First Blood" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "1369", "_score" : 10.558305, "_source" : { "overview" : "Col. Troutman recruits ex-Green Beret John Rambo for a highly secret and dangerous mission. Teamed with Co Bao, Rambo goes deep into Vietnam to rescue POWs. Deserted by his own team, he's left in a hostile jungle to fight for his life, avenge the death of a woman and bring corrupt officials to justice.", "title" : "Rambo: First Blood Part II" } }, { "_index" : "tmdb", "_type" : "movie", "_id" : "13258", "_score" : 6.4600153, "_source" : { "overview" : """Will Proudfoot (Bill Milner) is looking for an escape from his family's stifling home life when he encounters Lee Carter (Will Poulter), the school bully. Armed with a video camera and a copy of "Rambo: First Blood", Lee plans to make cinematic history by filming his own action-packed video epic. Together, these two newfound friends-turned-budding-filmmakers quickly discover that their imaginative ― and sometimes mishap-filled ― cinematic adventure has begun to take on a life of its own!""", "title" : "Son of Rambow" } } ] } }

Berdasarkan penilaian Anda terhadap performa model tersebut, sesuaikan daftar penilaian dan fiturnya. Kemudian, ulangi langkah 2-8 untuk meningkatkan hasil peringkat dari waktu ke waktu.

API Learning to Rank

Gunakan operasi Learning to Rank untuk bekerja dengan set dan model fitur secara terprogram.

Buat penyimpanan

Membuat indeks .ltrstore tersembunyi yang menyimpan informasi metadata seperti set dan model fitur.

PUT _ltr

Hapus penyimpanan

Menghapus indeks .ltrstore tersembunyi dan me-reset plugin.

DELETE _ltr

Buat set fitur

Membuat satu set fitur.

POST _ltr/_featureset/<name_of_features>

Hapus set fitur

Menghapus satu set fitur.

DELETE _ltr/_featureset/<name_of_feature_set>

Dapatkan set fitur

Mengambil satu set fitur.

GET _ltr/_featureset/<name_of_feature_set>

Buat Model

Membuat model.

POST _ltr/_featureset/<name_of_feature_set>/_createmodel

Hapus model

Menghapus model.

DELETE _ltr/_model/<name_of_model>

Dapatkan model

Mengambil model.

GET _ltr/_model/<name_of_model>

Dapatkan statistik

Memberikan informasi tentang perilaku plugin.

GET _ltr/_stats

Anda juga dapat menggunakan filter untuk mengambil satu stat:

GET _ltr/_stats/<stat>

Futthermore, Anda dapat membatasi informasi ke satu node di cluster:

GET _ltr/_stats/<stat>/nodes/<nodeId> { "_nodes" : { "total" : 1, "successful" : 1, "failed" : 0 }, "cluster_name" : "873043598401:ltr-77", "stores" : { ".ltrstore" : { "model_count" : 1, "featureset_count" : 1, "feature_count" : 2, "status" : "green" } }, "status" : "green", "nodes" : { "DjelK-_ZSfyzstO5dhGGQA" : { "cache" : { "feature" : { "eviction_count" : 0, "miss_count" : 0, "entry_count" : 0, "memory_usage_in_bytes" : 0, "hit_count" : 0 }, "featureset" : { "eviction_count" : 2, "miss_count" : 2, "entry_count" : 0, "memory_usage_in_bytes" : 0, "hit_count" : 0 }, "model" : { "eviction_count" : 2, "miss_count" : 3, "entry_count" : 1, "memory_usage_in_bytes" : 3204, "hit_count" : 1 } }, "request_total_count" : 6, "request_error_count" : 0 } } }

Statistik disediakan pada dua tingkat, simpul, dan klaster, seperti yang ditentukan dalam tabel berikut:

Statistik tingkat-simpul
Nama kolom Deskripsi
request_total_count Jumlah total permintaan peringkat.
request_error_count Jumlah total permintaan gagal.
Cache Statistik di semua cache (fitur, setfitur, model). Sebuah temuan cache terjadi ketika pengguna mengajukan kueri plugin dan model sudah dimuat ke dalam memori.
cache.eviction_count Jumlah pengosongan cache.
cache.hit_count Jumlah temuan cache.
cache.miss_count Jumlah cache meleset. Sebuah cache miss terjadi ketika pengguna mengajukan kueri plugin dan model belum dimuat ke dalam memori.
cache.entry_count Jumlah entri dalam cache.
cache.memory_usage_in_bytes Total memori yang digunakan dalam byte.
cache.cache_capacity_reached Menunjukkan bahwa batas cache tercapai.
Statistik tingkat-klaster
Nama kolom Deskripsi
penyimpanan Menunjukkan di mana set fitur dan metadata model disimpan. (Default adalah “.ltrstore”. Jika tidak, itu diawali dengan “.ltrstore_”, dengan nama yang disediakan pengguna).
stores.status Status indeks.
stores.feature_sets Jumlah set fitur.
stores.features_count Jumlah fitur.
stores.model_count Jumlah model.
status Status plugin berdasarkan status indeks tempat penyimpanan fitur (merah, kuning, atau hijau) dan keadaan pemutus sirkuit (terbuka atau tertutup).
cache.cache_capacity_reached Menunjukkan bahwa batasan cache tercapai.

Dapatkan statistik cache

Mengembalikan statistik tentang penggunaan cache dan memori.

GET _ltr/_cachestats { "_nodes": { "total": 2, "successful": 2, "failed": 0 }, "cluster_name": "opensearch-cluster", "all": { "total": { "ram": 612, "count": 1 }, "features": { "ram": 0, "count": 0 }, "featuresets": { "ram": 612, "count": 1 }, "models": { "ram": 0, "count": 0 } }, "stores": { ".ltrstore": { "total": { "ram": 612, "count": 1 }, "features": { "ram": 0, "count": 0 }, "featuresets": { "ram": 612, "count": 1 }, "models": { "ram": 0, "count": 0 } } }, "nodes": { "ejF6uutERF20wOFNOXB61A": { "name": "opensearch1", "hostname": "172.18.0.4", "stats": { "total": { "ram": 612, "count": 1 }, "features": { "ram": 0, "count": 0 }, "featuresets": { "ram": 612, "count": 1 }, "models": { "ram": 0, "count": 0 } } }, "Z2RZNWRLSveVcz2c6lHf5A": { "name": "opensearch2", "hostname": "172.18.0.2", "stats": { ... } } } }

Hapus cache

Membersihkan cache plugin. Gunakan ini untuk menyegarkan model.

POST _ltr/_clearcache