自定制的精准短文本搜索服务
APACHE-2.0 License
, , , , ,
git clone https://github.com/ysc/short-text-search.git
cd short-text-search
unix
chmod +x startup.sh & ./startup.sh
windows
./startup.bat
: http://localhost:8080/index.jsp
JSONAPI: http://localhost:8080/search_suggest.jsp?kw=%E6%B7%B1%E5%9C%B3%E4%B8%87%E7%A7%91&topN=10&highlight=true
short_text.txt
src/main/resources/short_text.txt
,
, , , :
short-text-search [master] du -h *.txt [master1|7
2.9M document.txt
1.0M index_id_to_document_id.txt
124M invert_index.txt
33M invert_index_length_status.txt
03:30, , ,
, , ,
:
//
SearchService.getShortTextSearcher().deleteIndex(100);
//
SearchService.getShortTextSearcher().updateIndex(new Document(100, ""));
1. 10, :
cat logs/short_text_search_logback* | grep | awk -F ' - ' '{print $2}' | sort -rn | awk '{print $2,$3,$4}' | head -n 10
:
: 141 228911-1000
: 133 228914-1000
: 131 249855-1000
: 129 249856-1000
: 125 249860-1000
: 122 231364-1000
: 114 249859-1000
: 111 233657-1000
: 107 231981-1000
: 107 231368-1000
, , +
, , :
cat logs/short_text_search_logback* | grep | awk -F ' - ' '{print $2}' | sort -rn | awk '{print $2,$3,$4}' | head -n 10
:
: 198 245296-1000
: 196 245292-1000
: 192 245295-1000
: 179 245297-1000
: 169 245298-1000
: 159 249862-1000
: 144 228911-1000
: 140 228914-1000
: 137 245299-1000
: 134 249855-1000
2. , :
cat logs/short_text_search_logback* | grep | awk -F ' - ' '{print $2}' | awk '{print $2,$3,$4}' | grep 245296-1000
:
: 0 245296-1000
: 1 245296-1000
: 20 245296-1000
: 0 245296-1000
: 198 245296-1000
, :
cat logs/short_text_search_logback* | grep 245296-1000 | awk -F ' - ' '{print $2}'
:
: beno, topN: 10, highlight: false 245296-1000
0 : 0 245296-1000
: [beno, b, e, n, o, be, en, no, ben, eno] 245296-1000
1 : 1 245296-1000
: 1283, : 17985, : 7.1337223 %, : 1000, : 5.5601892 % 245296-1000
20 : 20 245296-1000
0 : 0 245296-1000
198 : 198 245296-1000
3. , :
cat logs/short_text_search_logback* | grep | awk -F ' - ' '{print $2}' | awk -F ' ' '{print $2,$3}' | sort | uniq -c | sort -rn | head -n 10
:
28112 : 0
14490 : 1
5513 : 2
2115 : 3
1752 : 14
1197 : 13
1133 : 15
892 : 4
654 : 16
606 : 12
567 : 5
554 : 17
532 : 19
528 : 18
512 : 21
509 : 7
492 : 22
488 : 20
477 : 8
472 : 23
460 : 6
460 : 24
450 : 25
446 : 26
412 : 27
380 : 9
363 : 11
344 : 28
329 : 10
298 : 29
, 281121
4. 3, :
cat logs/short_text_search_logback* | grep | awk -F ' - ' '{print $2}' | awk '{if($1>=3000){print $1,$4,$1}}'| sort -rn | awk '{print $2,$1}' > cost-greater-3s.txt
5. , :
cat logs/short_text_search_logback* | grep | awk -F ' - ' '{print $2}' | awk '{print $4,$1}' > search_performance.txt