billie66 / esdemo Goto Github PK
View Code? Open in Web Editor NEWelasticsearch
elasticsearch
106.185.35.180
brew update && brew install elasticsearch
then I see
billie@bogon:~/apps/happycasts% brew install elasticsearch
==> Downloading https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.2.1.tar.gz
######################################################################## 100.0%
==> Caveats
Data: /usr/local/var/elasticsearch/elasticsearch_billie/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_billie.log
Plugins: /usr/local/var/lib/elasticsearch/plugins/
ElasticSearch requires Java 7; you will need to install an appropriate JDK.
To have launchd start elasticsearch at login:
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
Then to load elasticsearch now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
Or, if you don't want/need launchctl, you can just run:
elasticsearch --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
==> Summary
🍺 /usr/local/Cellar/elasticsearch/1.2.1: 31 files, 21M, built in 43 seconds
bundle exec rake environment elasticsearch:import:all
peter@linode-esdemo:~$ curl -XPUT 'http://localhost:9200/test/'
{"error":"IndexCreationException[[test] failed to create index]; nested: Elasti
csearchIllegalArgumentException[failed to find analyzer type [org.elasticsearch
.index.analysis.IkAnalyzerProvider] or tokenizer for [ik]]; nested: NoClassSett
ingsException[Failed to load class setting [type] with value [org.elasticsearch
.index.analysis.IkAnalyzerProvider]]; nested: ClassNotFoundException[org.elasti
csearch.index.analysis.ikanalyzerprovider.IkAnalyzerProviderAnalyzerProvider];
http://happycasts.net:9200/_cat/indices?v
http://happycasts.net:9200/episodes/_search/?size=1000&pretty=1
出了这个问题。
peter@AY140626154842267bcfZ:~/apps/ppweb$ bundle exec rake environment elasticsearch:import:model CLASS='User' FORCE=y
[!!!] Error when deleting the index: Faraday::ConnectionFailed
Connection refused - connect(2)
[!!!] Error when creating the index: Faraday::ConnectionFailed
Connection refused - connect(2)
rake aborted!
Faraday::ConnectionFailed: Connection refused - connect(2)
对比一下 solr 和 es
solr 和 es 看起来是没法比了,理由如下
总之,es 完胜,solr 已经不值得推荐了
happcasts 的搜索服务其实可以做得更好些。在模糊搜索方面还可以再加强。如果能够添加自动补全功能就更好了,即输即搜才是现代的搜索引擎。
elasticsearch 搜索中文的时候会按字的匹配,比如说搜索苹果
,得到的结果是包含 苹
或 果
所有条目,而期望的结果是只包含 苹果
的匹配项
当查找到匹配的字符串后,在前端通过 JS 处理后,高亮显示出来,但解决方法并不完美。
例如搜索 sed em
两个关键字,elasticsearch 会找到包含 sed
或 em
单词的匹配项,而 JS 则不管 em
, sed
是不是单词,都会高亮显示这两个字符串
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.