사전 식물 검색기능 개선과정 (검색어 글자 제한에 대해) #364
Replies: 5 comments
-
저는 한글자 검색도 가능했으면 좋겠어요~! 한글자일 땐 LIKE, 2글자 이상일 땐 ngram으로 분기할 수 있나요? |
Beta Was this translation helpful? Give feedback.
-
난초 계열을 |
Beta Was this translation helpful? Give feedback.
-
토큰 사이즈를 1로 조정해도 큰 무리가 없어 보입니다.
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
협의 완료로 close 하겠습니다. 아티클 참조 |
Beta Was this translation helpful? Give feedback.
-
To. BackEnd
안녕하세요 피움 백엔드 팀원 여러분.
저희 백엔드는 이번 레벨 4를 진행하면서 쿼리 분성 및 개선과정을 진행헀습니다.
기존에 사전 식물 검색이라는 기능을 구현하는 과정에서 like 절로 검색하도록 쿼리를 구성했었습니다.
해당 쿼리는 full scan을 통해 데이터를 찾게됩니다.
이에 해당 쿼리를 개선하기 위한 방법으로
FULLTEXT 인덱스
방식을 찾아보게 되었고 ngram Parser를 이용한 인덱싱을 이용하는 방법을 제안하고자 합니다.관련 공식문서: https://dev.mysql.com/doc/refman/8.0/en/fulltext-search.html
ngram parser 도입간 고려할 사항
mysql에서는 ngram parser의 token (나눌 단어의 개수)의 기본값이 2 입니다.
이는 다음 예시처럼
가울테리아
를가울
,울테
,테리
... 로 단어를 나눕니다.해당 방식을 도입하는 과정에서 다음과 같은 문제점을 생각할 수 있습니다.
이에 다음과 같은 해결방안을 구상할 수 있습니다.
요약
To. FrontEnd
서버 DB 성능 개선 과정에서 검색 조건을 2글자로 제한을 두는것에 대한 의견이 제시되었습니다.
서비스 정책을 2글자 이상 입력으로 정하는 것에 대해 어떻게 생각하시나요?
(강제사항이 아닙니다!! 한글자 조회도 충분히 구현 가능합니당)
ex)
Beta Was this translation helpful? Give feedback.
All reactions