Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
donsonioc2010 committed Nov 5, 2023
2 parents 009bb51 + 8919fb0 commit 535b66a
Show file tree
Hide file tree
Showing 23 changed files with 578 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions CloudSearch & Search Engine Service/CloudSearch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 🔎 Cloud Search

> :warning: 기술을 사용할지 고민하다 다른 기술을 사용하기로 하여 정리가 미흡합니다. 양해 바랍니다.
[Cloud Search 관련 용어 정리](./용어정리/Cloud%20Search%20관련%20용어정리.md)

[Cloud Search 개요](https://guide.ncloud-docs.com/docs/cloudsearch-overview)

웹 사이트에 필요한 검색 기능을 쉽게 구현하게 하는 클라우드 기반의 플랫폼.

별도의 인프라 구축 없이 간편하게 검색 엔진 만들기 가능.

DB 데이터의 업로드 과정 >>>

1. DB 데이터 업로드 요청 시 입력한 정보로 서버에서 데이터 질의
2. DB 서버에서 데이터를 받아 Cloud Search 문서(JSON)로 변환
3. 변환된 문서는 Cloud Search에 순차적으로 업로드되어 인덱싱

### Domain

- 도메인 생성하여 DB 연결이 가능해짐.
- 이미 만들어놓은 DB Server에 연결이 가능하고, 이 DB에서 내가 Indexing 방식, 검색 대상 문서를 설정할 수 있음.

![Alt text](./CloudSearch%20Images/image.png)

![Alt text](./CloudSearch%20Images/image-1.png)

- 색인용 컨테이너?? 검색용 컨테이너??

index를 가지는 컨테이너와 index로 찾아나갈 수 있는 데이터들이 있는 검색용 컨테이너가 존재

- 도메인의 섹션과 색인은 검색할 문서의 형식과 검색 목적에 맞게 정의해야함.
- 이후 검색 시 결과를 나타내는 데에 이용되는 가중치를 설정 가능
- 섹션 가중치 : 해당 섹션 정보의 중요도를 나타냄
- 문서 가중치 : 문서 가중치 함수에 따라 섹션 가중치를 이용하여 문서 가중치를 계산하며 별도 설정이 없으면 문서 가중치가 높은 순서대로 검색 결과 정렬
- StopWord(불용어), 동의어 설정 가능

### Monitoring

검색 추이에 대한 모니터링 가능.

네이버 콘솔에서 GUI로 제공

### Query

[검색 쿼리](https://guide.ncloud-docs.com/docs/cloudsearch-searchquery)

- 검색 요청 방법
- 요청 바디에 입력
- URI에 입력

### Ranking

[랭킹 수식](https://guide.ncloud-docs.com/docs/cloudsearch-ranking)

정렬 방식 별도 설정 없을 시 문서 가중치가 높은 순서대로 정렬.

검색 결과를 정렬하는 기준인 랭킹 점수를 계산하는 식이 **랭킹 수식**
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
377 changes: 377 additions & 0 deletions CloudSearch & Search Engine Service/Search Engine Service.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 📚 Cloud Search 관련 용어 정리

- Container·컨테이너

도커 컨테이너

- Domain·도메인

검색 엔진을 용도에 따라 구분하기 위해 제공하는 개념으로 여러 서비스, 개발, 테스트, 운영 환경에 따라 별도 도메인 생성 가능

- Index·색인

문서의 내용을 분석해서 검색하기 용이한 형태의 데이터를 만드는 행위 혹은 그 데이터

- Query Domain Specific Language (Query DSL)

네이버 클라우드 플랫폼의 Cloud Search에서 검색 엔진의 다양한 옵션을 활용할 수 있도록 json 형태로 지원하는 포맷

- Section·섹션

문서의 내용을 구성하는 항목. 문서의 구성 항목(ex : 상품명, 가격, 상품 설명, 추천 수, 태그)과 동일하게 정의(상품명, 가격, 상품 설명, 추천 수, 태그)

- Stopword·불용어

인터넷 검색 시 검색 용어로 사용하지 않는 단어

- Term·텀

검색 대상 문서, 검색어 등을 색인 분석기로 분석한 단어
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 📚 Search Engine Service 관련 용어 정리

- Bucket·버킷

데이터 저장 공간. 연관된 객체들을 그루핑한 최상위 디렉터리

- Coordinate Node·코디네이트 노드

외부에서 인덱싱, 검색 등의 요청을 받아 데이터 노드에 전달하고 요청 결과를 받아 반환하는 노드

- Data Node·데이터 노드

네이버 클라우드 플랫폼의 Search Engine Service에서 제공하는 Elasticsearch 클러스터 구성 요소 중 하나로 실제 데이터가 저장되는 서버이며 코디네이트 노드로만 통신하는 노드

- Elasticsearch

Apache Lucene을 기반으로 하는 오픈소스 RESTful 검색 및 분석 엔진으로 정형/비정형 데이터, 위치 정보, 메트릭 등 다양한 형태의 데이터를 저장하고 다양한 방법으로 검색 가능

- Index·색인

문서의 내용을 분석해서 검색하기 용이한 형태의 데이터를 만드는 행위 혹은 그 데이터

- JavaScript Object Notation(JSON)·제이슨

인간이 읽을 수 있는 데이터 교환용으로 설계된 경량 텍스트 기반 개방형 표준 포멧

- Kibana·키바나

**Elasticsearch**를 위한 오픈 소스 데이터 시각화 플러그인

- Manager Node·매니저 노드

네이버 클라우드 플랫폼의 Search Engine Service에서 제공하는 **Elasticsearch** 클러스터 구성 요소 중 하나로 **Elasticsearch** 클러스터를 관리하며 코디네이트 노드로 설정되어 데이터가 인입되는 통로로 사용하는 노드

- Master Node·마스터 노드

클러스터에 인덱스를 생성하거나 데이터 노드에 샤드를 할당하는 등 클러스터 관리 작업을 담당하는 노드

- Node·노드

재분배 지점이나 통신 종단점. 네트워크 기본 요소인 지역 네트워크에 연결된 컴퓨터와 그 안에 속한 장비를 통틀어 하나의 노드라고 지칭

- Primary Shard·프라이머리 샤드

단일 데이터를 다수의 데이터베이스로 쪼개어 나눈 블록들의 구간

- Shard·샤드

DB 클러스터에서 분할된 데이터 단위

- Secure Shell(SSH)·시큐어 셸(에스에스에이치)

암호화 기법을 이용하여 원격 서버 로그인 후 명령 수행 시 사용하는 프로토콜
61 changes: 61 additions & 0 deletions Papago/Papago Api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Papago API

[Papago Text Translation 개요](https://api.ncloud-docs.com/docs/ko/ai-naver-papagonmt)

![NCP 내에서 파파고 Api 사용 신청](./image/image.png)

![파파고 Api 인증 정보](./image/image-1.png)

![파파고 Api 공통 설정](./image/image-2.png)

- app 이름 : hook-killer
- Client ID(X-NCP-APIGW-API-KEY-ID) : ybakk0x770
- Client Secret(X-NCP-APIGW-API-KEY) : DQxOkhtAKEqN61A5vGrp5mYW1j66Qi7vR0R7fJh5

- VM Option으로 주어질 변수
- -Dpapago.X-NCP-APIGW-API-KEY-ID=ybakk0x770
- -Dpapago.X-NCP-APIGW-API-KEY=DQxOkhtAKEqN61A5vGrp5mYW1j66Qi7vR0R7fJh5

---

## Papago Translation Issue 해결

https://github.com/hook-killer/back-end/issues/57

작업은

`TranslationService`, `ArticleController`, `ArticleService`, `NoticeController`, `NoticeService` 에서 진행한다.

### TranslationService

실제로 파파고 API를 사용하여 통신하는 부분.

여기서 source, target에 따라 조건부 번역을 시도해야 할 듯 싶다. → 해보니까 아니었음!

### Article / Notice Controller

등록 / 수정이 일어나는 부분.

`@Transactional` 고려해야 할듯

여기에서 Service의 메소드를 호출하기 때문에..

흠 근데 컨트롤러에서 `@Transactional` 쓰는게 맞나?

### Article / Notice Service

`TranslationService`를 사용하여 실제로 게시글을 등록 / 수정하는 부분. → 여기서 CN, EN 번역 고려

create에서는 `@Transactional` 이 불필요하나,

update에서는 `@Transactional` 가 필요해보인다.

[Transaction Propagation and Isolation in Spring @Transactional](https://www.baeldung.com/spring-transactional-propagation-isolation)

![Alt text](./image/image-3.png)

`@Transactional(propagation = MANDATORY)`?

`@Transactional(propagation = REQUIRES_NEW)`?

Transactional은 `ArticleContent` 혹은 `NoticeContent` Entity 안의 update에 걸어주자.
Binary file added Papago/image/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Papago/image/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Papago/image/image-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Papago/image/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 535b66a

Please sign in to comment.