Arsitektur Layanan Modular Untuk mengindeks dan pencarian URL dengan kontennya menggunakan CouchDB+Lucene sebagai pencari.
Catatan: Proyek ini masih dalam pengembangan besar, harap diharapkan beberapa WIP!
Catatan: (Docker dan Docker-Compose diperlukan)
// 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
Catatan: Untuk reset data couchDB lengkap (peringatan, semua data akan dihapus):
docker-compose rm && rm DatabaseInit/dbinitstatus/.dbinitdone
Catatan: (Docker dan Docker-Compose diperlukan)
// 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
TODO:
Inisialisasi database CouchDB.
Untuk tes layanan cepat jalankan perintah ini:
cd DatabaseInit
./docker_build.sh
./docker_run.sh
Bereaksi Webapp UI.
Untuk tes layanan cepat jalankan perintah ini:
cd UI
./docker_build.sh
./docker_run.sh
open http://localhost:8080
Layanan web tangkapan layar sederhana yang ditenagai oleh Express dan Phantomjs. Forked dari Screenshot-App.
Dokumentasi asli tersedia di sini
Untuk tes layanan cepat jalankan perintah ini:
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
Konten sederhana Mengikis layanan web yang ditenagai oleh Express dan Cheerio.js
Untuk tes layanan cepat jalankan perintah ini:
cd GetContentFromURL
./docker_build.sh
./docker_run.sh
curl http://localhost:6000/?url=www.botdream.com
Buat database dan beberapa dokumen dan kemudian Anda dapat mulai mengatur dan menanyakan indeks seperti yang dijelaskan dalam readme CouchDB-Lucene.
Untuk tes layanan cepat jalankan perintah ini:
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
Info lebih lanjut tentang pencarian couchdb-lucene fullText di sini: couchdblucene-fuLltext-Search
Alat sederhana yang dibuat di Parse Google Chrome Bookmark mengekspor file html ke couchdb-lucene.
Untuk tes layanan cepat jalankan perintah ini:
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
UI eksperimental menggunakan vue.js, server http webpack-dev-server dasar, belum ada backend yang diimplementasikan, tidak ada wadah Docker yang tersedia!
Untuk tes layanan cepat jalankan perintah ini:
cd UI
npm install
npm start
open http://localhost:8080
Layanan URL-to-index sederhana. Kirim daging, dapatkan Sauge.
Ini mengambil URL yang diberikan, melewatkannya melalui GetContentFromUrl, kemudian mendorongnya ke database searchengine CouchDB di mana CouchDB-Lucene mengindeks dokumen.
curl -d 'url = http: //www.botdream.com' http: // localhost: 8000/url
Lalu saat selesai:
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=botdream&include_docs=true | jq .
Catatan: Mesin layanan sekarang diindeks dengan judul:
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_title?q=botdream&include_docs=true | jq .
Juga: DBProxy sekarang menerapkan titik akhir pencarian (ini menghindari UI untuk meminta data langsung ke CouchDB, juga di masa depan akan dimungkinkan untuk menggunakan mesin DB lainnya dan abstrak dengan layanan ini => Melihat Elasticsearch)
curl -X GET --silent http://localhost:8000/search/botdream | jq .