本文介绍了全文搜索本地/离线网站“网站”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始开发一个应用程序,该应用程序在本地创建一堆HTML文件,然后可以在系统上的任何Web浏览器(包括手机设备),他们被复制到。 HTML文件具有许多交互功能,所以它基本上是一个离线的网络应用程序。我的问题是,对这些HTML文件实施全文搜索的最佳方式是什么?基本上,应用程序应该索引它生成的HTML文件,但我们希望能够使HTML文件和生成的索引可下载并供用户浏览和离线搜索。如果不编写实际的应用程序来管理它,最好的方法是什么?例如,我已经使用Solr实现了它,用于演示/概念证明,并且工作正常......但是当然需要HTTP POST和GET请求到服务器进行索引和查询。因此,由于索引实际上只是文件,我想知道是否有一种方法可以在HTML文件中仅使用Javascript离线查询它们(并且不需要为Solr启动本地Web服务器),也许使用Lucene而不是Solr? p>

解决方案

感谢您向我介绍几种完全用Javascript编写的文本搜索解决方案!我想检查文本搜索的代码。




  • a href =http://dev.theladders.com/archives/2006/11/introducing_javascript_fulltex_1.html =nofollow> http://dev.theladders.com/archives/2006/11/introducing_javascript_fulltex_1.html





Lucene是用Java编写的,它需要一个Java(技术上说是一个JVM)进程。



PS1:如果您正在编辑自己的简单文本搜索会使它更有用。原创:跑步猫猫跑爱跑垃圾摇篮
梗阻:奔跑猫猫爱情废话废话

PS2:您也可以为拼写检查运行另一个Ngram-ized索引。





I'm starting development of an application that creates a bunch of HTML files locally that can then be browsed in whatever web browser is on the system (including mobile devices) to which they're copied. The HTML files have many interactive features, so it's essentially an offline web app. My question is, what is the best way to implement full-text search for these HTML files? Basically, the application should index the HTML files it generates, but we want to be able to make the HTML files and the generated index downloadable and available for users to browse and search offline. What is the best way to do this without writing an actual application to manage it? For example, I've implemented it using Solr for a demo/proof-of-concept and that works fine ... but of course that requires HTTP POST and GET requests to a server for indexing and querying. So since the indexes are really just files, I'm wondering if there's a way to query them offline (and without firing up a local web server for Solr) using just Javascript in the HTML files, maybe with Lucene instead of Solr?

解决方案

Thanks for introducing me to a few text search solutions written entirely in Javascript! I wanted to check out code for text search.


Lucene is written in Java and it needs a Java (technically a JVM) process to access.

PS1: If you are rolling your own simple text search, a stemmer in JS will make it more useful.

original: run running cat cats love loving crap crapping
stemmed: run run cat cat love love crap crap 

PS2: You can run another "Ngram-ized" index for spell checking too.


这篇关于全文搜索本地/离线网站“网站”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 06:06