Skip to content

Instantly share code, notes, and snippets.

View selcukusta's full-sized avatar

Selçuk Usta selcukusta

View GitHub Profile
{
"template": {
"query": {
"match": {
"title": "{{query_string}}"
}
}
}
}
curl -X POST \
http://localhost:9200/_search/template/basic_search_template \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"template": {
"query": {
"match": {
"title": "{{query_string}}"
}
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace netcore_elastic_search_template
{
curl -X PUT \
http://localhost:9200/career_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/career_sample_index/_bulk \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{"index":{"_index":"career_sample_index", "_type":"sample_type", "_id" : 1}}
{ "CompanyName" : "ABC Softwarehouse", "Position":"Software Developer", "Salary" : 5000, "Servicing" : true, "Location" : "41.165493, 28.532379"}
{"index":{"_index":"career_sample_index", "_type":"sample_type", "_id" : 2}}
{ "CompanyName" : "DEF Tech", "Position":"Software Developer", "Salary" : 5500, "Servicing" : false, "Location" : "41.153168, 28.544824"}
{"index":{"_index":"career_sample_index", "_type":"sample_type", "_id" : 3}}
{ "CompanyName" : "ASD Cloud Solutions", "Position":"Software Developer", "Salary" : 5250, "Servicing" : true, "Location" : "41.158358, 28.512380"}
curl -X POST \
http://localhost:9200/career_sample_index/_search \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"query": {
"function_score": {
"functions": [
{
"gauss": {
curl -X POST \
http://localhost:9200/career_sample_index/_search \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"query": {
"function_score": {
"query": {
"match_phrase": {
"Position": "Software Developer"
{
"took": 231,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 3,
{
"took": 6,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 4,
docker run -it --name teamcity-docker \
-v C:\teamcity-docker\data:/data/teamcity_server/datadir \
-v C:\teamcity-docker\logs:/opt/teamcity/logs \
-p 8111:8111 \
jetbrains/teamcity-server:latest