You can not select more than 25 topics 
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long. 
		
		
		
		
		
			
	
	
		
			
	
		
			This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
		 
	
		
		
			
				
				
					
						
						
						
							---
 
						
						
						
							layout: post
 
						
						
						
							title: 如何给博客加上全文搜索功能
 
						
						
						
							tags: [搜索, 博客, 全文]
 
						
						
						
							---
 
						
						
						
							
 
						
						
						
							  原来JavaScript比Java还难? ! <!--more-->     
 
						
						
						
							  
 
						
						
						
							# 起因
  
						
						
						
							 
						
						
						
							  其实我之前也想搞全文搜索,但是作为静态博客,全文搜索意味着客户端要遍历所有的文章,想想好像挺耗时就没搞。但是再想想我写几百万字可能还没有一张图片大,似乎对用户体验也不会有特别大的影响,而且最主要的是我之前博客用的那个[破烂玩意](https://github.com/androiddevelop/jekyll-search)它需要调用bootstrap库, , ,  
						
						
						
							  
 
						
						
						
							# 痛苦的写代码时间
  
						
						
						
							~~( ? , )     
 
						
						
						
							  后来我找到了[Simple-Jekyll-Search](https://github.com/christian-fei/Simple-Jekyll-Search)这个项目, , , , , , , , , , , , , , , , , , , , , , , , , , , ,  
						
						
						
							
 
						
						
						
							# 突发奇想的解决
  
						
						
						
							, , , , , , ?  
						
						
						
							  
 
						
						
						
							# 最终的代码
  
						
						
						
							`search.html`  : < https: // github . com / Mabbs / mabbs . github . io / blob / master / search . html >    
 
						
						
						
							  全文索引的代码 `search.json`  : < https: // github . com / Mabbs / mabbs . github . io / blob / master / search . json > 
 
						
						
						
							  
 
						
						
						
							# 后记
  
						
						
						
							, , , , , ? ! ,