模块化服务体系结构以使用CouchDB+Lucene作为搜索ENGENE的内容索引和搜索URL。
注意:这个项目仍在重大开发中,请期待一些WIP!
注意:(需要Docker和Docker-Compose)
// Build docker containers (1st time)
docker-compose build
// Launch all required services
# [PRODUCTION]
docker-compose up
# [DEVELOPMENT]
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
// Open UI
open http://localhost:8080
注意:对于完整的couchdb数据重置运行(警告,所有数据将被删除):
docker-compose rm && rm DatabaseInit/dbinitstatus/.dbinitdone
注意:(需要Docker和Docker-Compose)
// Test GetImageFromURL
open http://localhost:3000/?url=www.botdream.com&width=1024&height=900
// Test GetContentFromURL
curl http://localhost:6000/?url=www.botdream.com
// Open CouchDB UI
open http://localhost:5984/_utils/database.html?searchengine/_all_docs
// Test CouchDB+Lucene search
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=brilliant&include_docs=true | jq .
//DBProxy service
[POST] curl -d 'url=http://www.botdream.com' http://localhost:8000/url
[DELETE] curl -X DELETE http://localhost:8000/remove/http-botdream-com-botdream-com-botdream-com%2F2017-04-21T23%3A11%3A04.910Z | jq .
[GET] curl http://localhost:8000/search/botdream | jq .
// shutdown services
docker-compose stop
OR
CTRL+C in the original terminal
// clean services data (reset containers)
docker-compose rm
// when changing source code you should rebuild docker images, use this generic command to build all and ignore cache (will take some time, forces to rebuild all images from scratch)
docker-compose build --no-cache
托多:
CouchDB数据库初始化器。
对于快速服务测试,运行此命令:
cd DatabaseInit
./docker_build.sh
./docker_run.sh
React WebApp UI。
对于快速服务测试,运行此命令:
cd UI
./docker_build.sh
./docker_run.sh
open http://localhost:8080
由Express和Phantomjs提供支持的简单屏幕截图Web服务。从屏幕截图分配。
原始文档可在此处避免
对于快速服务测试,运行此命令:
cd GetImageFromURL
./docker_build.sh
./docker_run.sh
open http://localhost:3000/?url=www.botdream.com&width=1024&height=900
// or with clipping params
open http://localhost:3000/?url=www.botdream.com&width=1024&height=900&clipRect=%7B%22top%22%3A0%2C%22left%22%3A0%2C%22width%22%3A1024%2C%22height%22%3A800%7D
curl http://localhost:3000/?url=www.botdream.com&width=1024&height=900 > botdream.png
curl --silent http://localhost:3000/?url=www.botdream.com&width=1024&height=900 | imgcat
由Express and Cheerio.js提供动力的简单内容刮擦Web服务
对于快速服务测试,运行此命令:
cd GetContentFromURL
./docker_build.sh
./docker_run.sh
curl http://localhost:6000/?url=www.botdream.com
创建一个数据库和一些文档,然后您可以开始设置和查询索引,如Couchdb-Lucene Readme中所述。
对于快速服务测试,运行此命令:
cd CouchDBLucene
docker-compose up
./database_init.sh
open http://localhost:5984/_utils/
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=nirvana&include_docs=true | jq .
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=einstein&include_docs=true | jq .
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=brilliant&include_docs=true | jq .
// Clear CouchDB data
docker-compose rm
有关Couchdb-Lucene FullText的更多信息,这里:Couchdblucene-Fulltext-Search
一个简单的工具,可以在解析Google Chrome Book Markit将HTML文件出口到CouchDB-Lucene中。
对于快速服务测试,运行此命令:
cd SendFavoritesToCouchDB
# export Chrome Bookmark file to ./bookmarks_sample.html
# ./build.sh # in case you need to change the sourcecode and compile the tool
# Launch CouchDB-Lucene service and initialize database
# Launch GetContentFromURL service
./SendFavoritesToCouchDB ./bookmarks_sample.html
使用vue.js,基本的WebPack-Dev-server HTTP服务器的实验UI,尚未实现后端,都无法使用Docker容器!
对于快速服务测试,运行此命令:
cd UI
npm install
npm start
open http://localhost:8080
简单的URL到索引服务。发送肉,获得帆。
这将采用给定的URL,将其通过GetContentFromurl,然后将其推入CouchDB-Lucene索引文档的searchengine Couchdb数据库中。
curl -d'url = http://www.botdream.com'http:// localhost:8000/url
然后完成后:
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=botdream&include_docs=true | jq .
注意:服务引擎现在按标题索引:
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_title?q=botdream&include_docs=true | jq .
另外:DBProxy现在正在实现搜索端点(这避免了UI直接需要数据到CouchDB,也将来也可以使用其他DB引擎并使用此服务=>查看Elasticsearch)
curl -X GET --silent http://localhost:8000/search/botdream | jq .