Created
March 24, 2018 11:36
-
-
Save keremcankabadayi/ee2204726e958250748d48b8ded70d54 to your computer and use it in GitHub Desktop.
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
https://github.com/moshe/elasticsearch_loader | |
$ pip install elasticsearch-loader | |
# json dosyasının formatı diğer dosya gibi olacak | |
sonra elasticsearch ve kibana çalıştır | |
$ elasticsearch_loader --index titles --type incident json titles.json | |
# titles.json dosyanın olduğun dizinde çalıştır veya en sona path yaz | |
# kibana console gir | |
http://localhost:5601/app/kibana#/dev_tools/console?_g=() | |
// ALTTAKİLER KİBANA CONSOLE YAZILACAK | |
# oluşturduğun bütün indexler için | |
$ GET /_cat/indices?v | |
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size | |
yellow open titles tLPR0pCwQWOylznIiWJymA 5 1 170109 0 32mb 32mb | |
# Burda toplam 170109 olacak | |
# Bütün sonuçları görmek için | |
$ GET _search | |
{ | |
"query": { | |
"match_all": {} | |
} | |
} | |
# Belirli bir kelime aratmak için | |
$ GET _search | |
{ | |
"query": { | |
"match": { | |
"title": "Dünya" | |
} | |
} | |
} | |
# Burdan dönecek sonuç sayısı "total": 328 |
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
[ | |
{ | |
"CourseId":35, | |
"UnitId":12390, | |
"title":"Dünya Mirası Sözleşmesi", | |
"id":"16069", | |
"CourseName":"ARK102U_ARKEOLOJİK ALAN YÖNETİMİ", | |
"FieldId":8, | |
"field":"TARİH"}, | |
{ | |
"CourseId":48, | |
"UnitId":396, | |
"title":"Hollandez Sos", | |
"id":"16070", | |
"CourseName":"ASC205U_TEMEL MUTFAK TEKNİKLERİ", | |
"FieldId":29, | |
"field":"AŞÇILIK"}, | |
{ | |
"CourseId":182, | |
"UnitId":1522, | |
"title":"Kuzey Afrika", | |
"id":"16072", | |
"CourseName":"CEK303U_ISTIHDAM VE ISSIZLIK", | |
"FieldId":11, | |
"field":"İKTİSAT"}, | |
{...}, | |
{...}, | |
{...}, | |
{...}, | |
{ | |
"CourseId":35, | |
"UnitId":12390, | |
"title":"Dünya Miras Listesi", | |
"id":"16077", | |
"CourseName":"ARK102U_ARKEOLOJİK ALAN YÖNETİMİ", | |
"FieldId":8, | |
"field":"TARİH" | |
} | |
] |
GET /titles/incident/_search
{
"query": {
"span_near" : {
"clauses" : [
{ "span_term" : { "title" : "dünya" } },
{ "span_term" : { "title" : "sözleşmesi" } },
{ "span_term" : { "title" : "mirası" } }
],
"slop" : 4,
"in_order" : false
}
}
}
GET /titles/incident/_search
{
"query" : {
"percolate" : {
"field": "query",
"document" : {
"title" : "Arkeoloji, arkeolojik yöntemlerle ortaya çıkarılmış kültürleri, sosyoloji, coğrafya, tarih, etnoloji gibi birçok bilim dalından yararlanarak araştıran ve inceleyen bilim dalıdır. Türkçeye yanlış bir şekilde kazıbilim olarak çevrilmiş olsa da kazı, arkeolojik araştırma yöntemlerinden sadece bir tanesidir."
}
}
},
"highlight": {
"fields": {
"title": {}
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GET /titles/incident/_search
{
"query" : {
"match": {
"title": "dünya"
}
},
"highlight": {
"fields": {
"title": {}
}
}
}