Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
cheonjeongdae committed Mar 13, 2019
1 parent 9861c28 commit 6dafde6
Showing 1 changed file with 260 additions and 6 deletions.
266 changes: 260 additions & 6 deletions 스터디.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,119 @@
}
}

PUT /slipp-study1
{
"settings": {
"index": {
"number_of_replicas": "1",
"number_of_shards": "1",
"analysis" : {
"analyzer" : {
"std" : {
"type" : "standard"
}
}
}
}
},
"mappings": {
"accessLog": {
"properties": {
"accessPointId": {
"type": "keyword",
"fields": {
"analyzed": {
"type": "text"
}
}
},
"application": {
"type": "keyword",
"fields": {
"analyzed": {
"type": "text"
}
}
},
"band": {
"type": "keyword",
"fields": {
"analyzed": {
"type": "text"
}
}
},
"bandwidth": {
"type": "double"
},
"category": {
"type": "text",
"analyzer" : "std"
},
"customer": {
"type": "keyword",
"fields": {
"analyzed": {
"type": "text"
}
}
},
"department": {
"type": "text"
},
"downloadCurrent": {
"type": "double"
},
"downloadTotal": {
"type": "integer"
},
"inactiveMs": {
"type": "integer"
},
"location": {
"type": "geo_point"
},
"mac": {
"type": "keyword",
"fields": {
"analyzed": {
"type": "text"
}
}
},
"networkId": {
"type": "keyword",
"fields": {
"analyzed": {
"type": "text"
}
}
},
"signalStrength": {
"type": "integer"
},
"time": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
},
"uploadCurrent": {
"type": "double"
},
"uploadTotal": {
"type": "integer"
},
"usage": {
"type": "double"
},
"username": {
"type": "text",
"analyzer" : "std"
}
}
}
}
}

3) ����
- #logstash ��ġ��� bin>logstash.bat -f ../sample/study_data.conf
* 1000���ε�.... �� 999���� ����... ��.��
Expand All @@ -169,7 +282,8 @@
fields �Ӽ��� ���� �ʵ带 ���� ���� ������� ����� �� �ִ� ���ο� �־� �ſ� ������ ����̴�.
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/multi-fields.html

3 ���� �� �ǽ�
3 ���� �ؽ�Ʈ �˻�
- �׸� Term_Level_Query.png
- �˻� ��û�ϱ�
GET /_search
GET /index/_search
Expand All @@ -187,13 +301,153 @@
"query" : {
"match_all" : {}
}
��) "match_all": { "boost" : 1.2 }
- "match_none": {} �� match all�� �ݴ� �����̴�.
2) match
- ��κ��� ���� �ؽ�Ʈ �˻� �䱸 ���׿� ����ϴ� �⺻ ����.
- ��κ��� ���� �ؽ�Ʈ �˻� �䱸 ���׿� ����ϴ� �⺻ ����. �⺻ �ʵ忡 ���� �м��⸦ �ν��ϴ� ���� ���� ���� �� �ϳ�
* ���� ���� ����(High-Level Query) : ���� �ؽ�Ʈ ������ ����ȭ ���� ���� �ؽ�Ʈ �ʵ忡 ������ �� ������, �̷��� ������
�м� �������� �ν���. ���� �ؽ�Ʈ ������ ���� �˻� ������ �����ϱ� ���� �˻� �� ������� �м��� ������
�켱 �ʵ� ������ search_analyzer�� ���ǵƴ��� Ȯ���� �ùٸ� �м��⸦ ã�Ƴ���, �ʵ� ���� �м��Ⱑ ���ǵ��� �ʾҴٸ�
���� �������� ���ǵ� �м��⸦ ã�´�. ���� ���� �ؽ�Ʈ ������ �⺻ �ʵ忡 �м� ������ �ν��ϰ� ���� �˻� ������
�����ϱ� ���� �ùٸ� �м� ������ �����Ѵ�
GET /slipp-study1/_search
{
"query": {
"match": {
"username": "Melvin Test1"
}
}
}.
- �ѱ� ������, slipp-study, slipp-study1 �� �������� �𸣰ڴ�.
- ���� ����
��. ���� ��ġ�ϴ� ��ť��Ʈ�� ã�� ���ھ ���� ���� �������� ����
��. ��ť��Ʈ�� ���� ������ ���, ��ť��Ʈ�� �� �� ��� ���� ������ ���� ������ �ƴϰų�
���� �������� ���� �ٸ� ��ť��Ʈ ���� �� ���� ���ھ ������ ��
��. ����� or �� ���Եdz� ���� ���ھ �Ҵ� �Ѵ�.
=> ���� ��ġ�ϴ� ��ť��Ʈ�� ã�� ���ھ ���� ���� �������� ����
=> ��ť��Ʈ�� ���� ������ ���, ��ť��Ʈ�� �� �� ��� ���� ������ ���� ������ �ƴϰų�
���� �������� ���� �ٸ� ��ť��Ʈ ���� �� ���� ���ھ ������ ��
=> ����� or �� ���Եdz� ���� ���ھ �Ҵ� �Ѵ�.
* slipp-study index �� ��� ���� ������ �ִ� �͵��� �� ������� �ʾҴ�.
fields �� ��������, �ƴ� �ٸ� �̽��� �ִ��� ������ ã�� ���ߴ�.
- ��� �ɼ��� ����
��. Operator
Match ���� �⺻ ������ or �����ڸ� ����� ����� �����Ѵ�.
Operator�� ����� and ������ �� �� �ִ�.
GET /slipp-study1/_search
{
"query": {
"match": {
"username": {
"query" : "Melvin Test1",
"operator": "and"
}
}
}
}
��. minimum_should_match
or �����ڸ� �״�� ����ϵ�, ����� ������ ��ť��Ʈ���� ��ġ�ϴ� ����� �ּ� ������ ������ �� ����
GET /slipp-study1/_search
{
"query": {
"match": {
"username": {
"query" : "Melvin Test4",
"minimum_should_match": "1"
}
}
}
}
�� ���� �� ����� 2�� ���� ���� 1���� ��������, 1�� �������� 5���� ����
��. Fuzziness
������Ÿ�� �Ÿ�(Levenshtein edit distance) �˰������� ������� �ϸ�, ���� ���ڿ��� �ٸ� ���ڿ��� �����ϱ� ���� ���� Ƚ���� ����
������ ���� �� �ִ� ������ ����, ����, ��ü, ġȯ�� �ǹ���. �Ű� ������ 0, 1, 2, AUTO �� �� �ϳ��� ����� �� ����
GET /slipp-study1/_search
{
"query": {
"match": {
"username": {
"query" : "Hogen aest1",
"fuzziness": "1"
}
}
}
}
Hogan => Hogen, Test1 => aest1 ���� �˻��ߴ�. 1���� Ʋ�� ���� ������ �˻�
�Ϸ���ƽ��ġ�� ��ġ�ϴ� �� �߰��� ������ �ϹǷ� fuzziness �� ����� ��� �۾�
�߰� �Ű� ������ ���� �ؾ� ��
max_expansions : Ȯ�� �� �ִ� ��� ������ ��Ÿ��
prefix_length: 0, 1, 2 ���� ���ڸ� ����. fuzziness �˻� ���� ������ prefix_length �Ű� ������ ������ ���� ���ķ� ����
3) match phrase
- �� �������� �ʰ�, �Ϸ��� �ܾ ��ġ��Ű�� ����
������ �ܾ ��Ȯ�� ������ ���� �ܾ ã�� ��
GET /slipp-study1/_search
{
"query": {
"match_phrase": {
"username": {
"query": "Melvin Test",
"slop": 1
}
}
}
}
- slop �Ű� ������ �����Ͽ� ���� ������ �dz� �� �� �ִ� �ܾ� ������ ���� �� �� ����
0, 1, 2, 3 ����. �⺻���� 0
4) match phrase_prefix
- phrase �� ������ ������ �ܾ�� ��ġ�ϴ� ���� ������ ã�´�.
default ���� 50�̴�. �Ʒ� ������ 3�� �༭ ó�� 3���� ã��
GET /slipp-study1/_search
{
"query": {
"match_phrase_prefix": {
"username": {
"query": "Test",
"max_expansions": 3
}
}
}
}
5) Multi Match
- match �� Ȯ�� �������� ���� �ʵ忡�� ��ġ�ϴ� ������ ���� �� �� ����.
�پ��� �ɼ��� ������ ��ť��Ʈ�� ��ü ���ھ ������ �� ����
username �ʵ�� department �ʵ忡�� develop or gilDong�� ã��
GET /slipp-study1/_search
{
"query": {
"multi_match": {
"query": "develop gilDong",
"fields": [
"username",
"department"
]
}
}
}
- Ư�� �ʵ��� ���ھ� ������ ���� department�� 2�踦 �� �ָ� ���ĵǴ� �÷� ������ �޶���
GET /slipp-study1/_search
{
"query": {
"multi_match": {
"query": "develop gilDong",
"fields": [
"username",
"department^2"
]
}
}
}

4 ���� ���� �ۼ�
- �ϳ� �̻��� ������ ������ �� ������ ������ �ۼ��� �� �����
1) Constant score ����












category

Expand Down

0 comments on commit 6dafde6

Please sign in to comment.