Skip to content

Instantly share code, notes, and snippets.

View selcukusta's full-sized avatar

Selçuk Usta selcukusta

View GitHub Profile
{
"took": 14,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 1,
curl -X PUT \
http://localhost:9200/suggest_sample_index \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"analyzer": {
curl -X POST \
http://localhost:9200/suggest_sample_index/_bulk \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{"index":{"_index":"suggest_sample_index", "_type":"sample_type", "_id" : 1}}
{ "title":"Fransız Basın Ajansı prestij ödüllerini dağıttı", "title_autocomplete":"Fransız Basın Ajansı prestij ödüllerini dağıttı" }
{"index":{"_index":"suggest_sample_index", "_type":"sample_type", "_id" : 2}}
{ "title":"Doktorlara kamu görevi zorunluluğu kalkıyor","title_autocomplete":"Doktorlara kamu görevi zorunluluğu kalkıyor"}
{"index":{"_index":"suggest_sample_index", "_type":"sample_type", "_id" : 3}}
{ "title":"Doksanların müzikleri raflardaki yerini alıyor","title_autocomplete":"Doksanların müzikleri raflardaki yerini alıyor"}
curl -X POST \
http://localhost:9200/suggest_sample_index/_search \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"suggest": {
"title-suggest" : {
"prefix" : "do",
"completion" : {
"field" : "title_autocomplete"
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 0,
curl -X POST \
http://localhost:9200/suggest_sample_index/_search \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"_source" : "title_autocomplete",
"suggest": {
"title-suggest" : {
"prefix" : "do",
"completion" : {
curl -X POST \
http://localhost:9200/suggest_sample_index/_search \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"_source" : "title_autocomplete",
"suggest": {
"title-suggest" : {
"prefix" : "dög",
"completion" : {
curl -X POST \
http://localhost:9200/suggest_sample_index/_search \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"_source" : "title_autocomplete",
"suggest": {
"title-suggest" : {
"regex" : "s[u|ü]rat",
"completion" : {
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 0,
server {
set $new_cookie $http_cookie;
if ($http_cookie ~ "(.*)(?:^|;)\s*non_ascii=[^;]+(.*)") {
set $new_cookie $1$2;
}
proxy_set_header Cookie $new_cookie;
listen 8080;
server_name localhost;