http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 选择 jdk-8u25-macosx-x64.dmg 下载
Download and unzip the Elasticsearch official distribution.
cp ~/Downloads/elasticsearch /usr/share/elasticsearch
cd /usr/share/elasticsearch/
Run bin/elasticsearch
on unix, or bin\elasticsearch.bat on windows.
Run curl -X GET http://localhost:9200/
or
brew install elasticsearch
==> Downloading https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.4.tar.gz ######################################################################## 100.0% ==> Caveats Data: /usr/local/var/elasticsearch/elasticsearch_xuch/ Logs: /usr/local/var/log/elasticsearch/elasticsearch_xuch.log Plugins: /usr/local/var/lib/elasticsearch/plugins/
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.3.4: 36 files, 30M, built in 5.0 minutes
下载ik插件的地方很多,我选择从https://github.com/medcl/elasticsearch-analysis-ik
wget https://github.com/medcl/elasticsearch-analysis-ik/archive/v1.2.6.zip
unzip v1.2.6.zip #get dir: elasticsearch-analysis-ik-1.2.6
cp elasticsearch-analysis-ik-1.2.6/config/ik /usr/share/elasticsearch/config
path.conf: /usr/share/elasticsearch/config
path.plugins: /usr/share/elasticsearch/plugins
#################################### Plugin ###################################
# If a plugin listed here is not installed for current node, the node will not start.
#
#plugin.mandatory: mapper-attachments,lang-groovy
index:
analysis:
tokenizer:
mmseg_maxword:
type: mmseg
seg_type: "max_word"
mmseg_complex:
type: mmseg
seg_type: "complex"
mmseg_simple:
type: mmseg
seg_type: "simple"
analyzer:
ik:
alias: [ik_analyzer]
type: org.elasticsearch.index.analysis.IkAnalyzerProvider
ik_max_word:
type: ik
use_smart: false
ik_smart:
type: ik
use_smart: true
mmseg:
alias: [news_analyzer, mmseg_analyzer]
type: org.elasticsearch.index.analysis.MMsegAnalyzerProvider
mmseg_maxword:
type: custom
filter: [lowercase]
tokenizer: mmseg_maxword
mmseg_complex:
type: custom
filter: [lowercase]
tokenizer: mmseg_complex
mmseg_simple:
type: custom
filter: [lowercase]
tokenizer: mmseg_simple
#index.analysis.analyzer.default.type: mmseg
index.analysis.analyzer.default.type: ik