JEFFREY

feiworks.com

Docker & Elasticsearch

docker pull elasticsearch:6.5.0

docker run -d \
--name es \
-p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms1600m -Xmx1600m" \
elasticsearch:6.5.0

docker exec -it es /bin/bash
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.5.0/elasticsearch-analysis-ik-6.5.0.zip

docker cp es:/usr/share/elasticsearch/config /data/es
docker cp es:/usr/share/elasticsearch/data /data/es
docker cp es:/usr/share/elasticsearch/plugins /data/es

elasticsearch.yml config:
node.name: master
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0

docker run -d \
--name es \
-p 9200:9200 -p 9300:9300 \
-v /data/es/config:/usr/share/elasticsearch/config \
-v /data/es/data:/usr/share/elasticsearch/data \
-v /data/es/plugins:/usr/share/elasticsearch/plugins \
elasticsearch:6.5.0
PUT http://149.129.124.46:9200/rss_entries
{
  "settings": {
    "analysis": {
      "analyzer": {
        "ik": {
          "tokenizer": "ik_max_word"
        }
      }
    }
  },
  "mappings": {
    "entries":{
      "properties": {
        "content": {
          "type": "text",
          "analyzer": "ik",
          "search_analyzer": "ik_max_word"
        },
        "title": {
          "type": "text",
          "analyzer": "ik",
          "search_analyzer": "ik_max_word"
        }
      }
    }
  }
}
select a.id,a.title,link,updated,content,author,comments,c.title feed_title,feed_url,d.title feed_cat from ttrss_entries a left join ttrss_user_entries b on a.id=b.ref_id left join ttrss_feeds c on b.feed_id=c.id left join ttrss_feed_categories d on c.cat_id=d.id order by a.id


发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.5 Zero

Copyright @ 2014-2019 All Rights Reserved.
feiworks.com