简体   繁体   English

如何在Ubuntu上使用Elasticsearch进行索引

[英]How to index using elasticsearch on ubuntu

I am trying to install elasticsearch on Ubuntu 12.04 to work with tire and mongodb, I used the following code to do the installation and everything seems to be working fine: 我正在尝试在Ubuntu 12.04上安装elasticsearch以与Tire和mongodb一起使用,我使用以下代码进行安装,并且一切似乎都正常进行:

wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.deb
sudo dpkg -i elasticsearch-0.90.2.deb
sudo service elasticsearch start

Elasticsearch appears to have installed to usr/share/elasticsearch but no config/elasticsearch.yml file was created during installation, where can i create/get this file and index the data? Elasticsearch似乎已安装到usr / share / elasticsearch,但是在安装过程中未创建config / elasticsearch.yml文件,在哪里可以创建/获取此文件并为数据建立索引?

Try these commands for starting and stopping elastic search: 尝试使用以下命令来启动和停止弹性搜索:

sudo service elasticsearch start
sudo service elasticsearch stop

I think you are looking for this query just run it in terminal(project directory) 我认为您正在寻找此查询,只需在终端(项目目录)中运行它

rake environment tire:import CLASS=Model_Name FORCE=true

Give your Model Name where you have implemented tire 在您实施轮胎的地方提供模型名称

let me know your feedback 让我知道你的反馈

Answers are found in elasticsearch guide 答案在elasticsearch指南中找到

http://www.elasticsearch.org/guide/reference/setup/installation/ http://www.elasticsearch.org/guide/reference/setup/installation/

After downloading the latest release and extracting it, elasticsearch can be started using: 下载最新版本并将其解压缩后,可以使用以下命令启动elasticsearch:

$ bin/elasticsearch $ bin / elasticsearch

Under *nix system, the command will start the process in the background. 在* nix系统下,该命令将在后台启动该进程。 To run it in the foreground, add the -f switch to it: 要在前台运行它,请在其上添加-f开关:

$ bin/elasticsearch -f $ bin / elasticsearch -f

ElasticSearch is built using Java, and requires at least Java 6 in order to run. ElasticSearch是使用Java构建的,并且至少需要Java 6才能运行。 The version of Java that will be used can be set by setting the JAVA_HOME environment variable. 可以通过设置JAVA_HOME环境变量来设置将使用的Java版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM