# 150줄의 파이썬 코드로 Full-Text 검색엔진 만들기

> Clean Markdown view of GeekNews topic #4014. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=4014](https://news.hada.io/topic?id=4014)
- GeekNews Markdown: [https://news.hada.io/topic/4014.md](https://news.hada.io/topic/4014.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2021-04-05T10:22:23+09:00
- Updated: 2021-04-05T10:22:23+09:00
- Original source: [bart.degoe.de](https://bart.degoe.de/building-a-full-text-search-engine-150-lines-of-code/)
- Points: 30
- Comments: 1

## Topic Body

영어 위키피디아 제목+요약 전체 데이터를 가지고, 특별한 기술이 아닌 검색엔진의 기초를 차근차근 설명한 글

1. Abstract 개체를 만들어서 데이터 준비

2. Index 생성 : Token화 및 필터링

ㅤ→ 소문자

ㅤ→ 어간 추출(Stemming)

ㅤ→ 영어에서 가장 많이 쓰이는 25개 단어 제외(the,be,to,of,a..)

3. 기본 검색 만들기

4. 연관도 기능 추가 : Term Frequency(요약문에서 해당 단어가 얼마나 많이 쓰였나)

5. Inverse Document Frequency 추가 : 이 문서에 연결된 다른 문서들의 수

코드 : https://github.com/bartdegoede/python-searchengine

## Comments



### Comment 4786

- Author: xguru
- Created: 2021-04-05T10:22:27+09:00
- Points: 3

한글 초성 검색도 지원하는 퍼지 문자열 검색 https://news.hada.io/topic?id=3631

이 글과 기술적 기반이나 구현은 전혀 다르지만, 기초적인 부분을 단계별로 자세히 설명한 글이라 재미나게 읽었습니다.

이런 전문검색/토픽 모델링/도큐먼트 인덱싱/유사도 관련한 기능을 좀 더 본격적으로 구현한 파이썬 라이브러리들은 여러 개 있습니다.

- Whoosh : https://pypi.org/project/Whoosh/

- GenSim : https://github.com/RaRe-Technologies/gensim

SQLite 는 Full-Text-Search 확장이 따로 있습니다.

- SQLite FTS5 Extension : https://www.sqlite.org/fts5.html
