Giter VIP home page Giter VIP logo

esdemo's People

Contributors

billie66 avatar happypeter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esdemo's Issues

install es on Mac

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

ik error

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];

es 常用 API

  1. 列出所以 Index
http://happycasts.net:9200/_cat/indices?v
  1. 列出 index 中的所有 document
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 pk es

对比一下 solr 和 es

solr 和 es 看起来是没法比了,理由如下

总之,es 完胜,solr 已经不值得推荐了

增强功能

http://tinysou.com/plan.html

happcasts 的搜索服务其实可以做得更好些。在模糊搜索方面还可以再加强。如果能够添加自动补全功能就更好了,即输即搜才是现代的搜索引擎。

中文搜索

elasticsearch 搜索中文的时候会按字的匹配,比如说搜索苹果,得到的结果是包含 所有条目,而期望的结果是只包含 苹果 的匹配项

highlight problem

当查找到匹配的字符串后,在前端通过 JS 处理后,高亮显示出来,但解决方法并不完美。

例如搜索 sed em 两个关键字,elasticsearch 会找到包含 sedem 单词的匹配项,而 JS 则不管 em , sed 是不是单词,都会高亮显示这两个字符串

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.