- 浏览: 132053 次
- 性别:
- 来自: 广州
-
文章分类
最新评论
-
saieuler:
最近想学,标记一下
Programming.Collective.Intelligence中对常用机器学习算法的总结 -
backsnow:
Primal中,显式计算Hessian矩阵的复杂度为nd^2, ...
svm的复杂度 -
backsnow:
调试运行时报~/workspace/mahout/exampl ...
mahout在eclipse下的开发环境 -
backsnow:
真见鬼,之前中文论文用latex打开变成乱码,把编码改一下再改 ...
Latex简历模板下载位置 -
backsnow:
我在将当前用户加入hadoop组的时候发现原来所属的组不见了, ...
ubuntu中用户组的问题
在eclipse中建立solr工程的时候,遇到的错误快把我搞崩溃了。先copy这个基本的建立过程。
by Amit Nithianandan, Senior Search Engineer at Zvents Inc.
Apache's Solr is a powerful software package that allows you to develop your own search engine in no time. It's purely written in Java using Lucene at its core and can run inside any servlet container such as Tomcat (or Jetty). Eclipse is an IDE that makes developing Java applications incredibly easy because of its wealth of features such as code completion and refactoring capabilities not to mention the number of free plugins available to further make development easier. I find it much easier to keep everything contained in one place and being able to code, debug, and test inside of Eclipse makes developing my search engine much easier. This simple tutorial will show you how to setup Apache Solr to run inside Eclipse using a free third-party plugin that runs Jetty inside Eclipse.
You will need:
Eclipse (http://www.eclipse.org ). I am using Eclipse 3.4 but this should also work just fine in Eclipse 3.5.
RunJettyRun plugin (http://code.google.com/p/run-jetty-run/wiki/GettingStarted
)
Apache Solr (Any version should suffice. I am using 1.4.)
Step One: Basic Setup
Download and extract both Eclipse and Apache Solr tar files somewhere on your disk. Since Solr has some XML configuration files, I would also suggest installing the Eclipse WTP (Web Toolkit Platform) that gives you some good built-in XML editors.
Follow the Getting Started guide in the RunJettyRun wiki to install the plugin. It should be pretty fast and easy.
Step Two: Create your Java project
Create a standard Java project in Eclipse (File..New..Java Project). Call it what you wish (I called it "TestSolr"). The default options should be fine and click through the wizard to see all the options or click Finish at your first chance to get done faster.
Here you should see your TestProject in your workspace with a blank src folder.
Step Three: Setup the Solr webapp in your Eclipse project.
This is where the RunJettyRun plugin installed earlier gets used. This plugin allows you to develop, run and debug web applications inside Eclipse allowing you to take advantage of Eclipse's powerful code editing and debugging capabilities. It's also one of the simpler web application development plugins available. Eclipse supports full blown web development but for the purposes of this tutorial and developing needs, this plugin is more than enough.
- Inside the TestSolr directory, create a folder called "webapp". Do this by right clicking on the "TestSolr" in the workspace, select "New" and then "Folder".
- At a command prompt, unjar the apache-solr-1.4.0.war in this webapp folder. In Windows, this would be done by the following command:
- jar -xvf c:\applications\apache-solr-1.4.0\dist\apache-solr-1.4.0.war
- The contents of the war file should be in the webapp folder. To confirm, right click on the "TestSolr" folder in the Eclipse workspace and select "Refresh."
- Add all the jar files in the webapp/WEB-INF/lib to the Build Path. This is done by selecting all the jars and right click on any of the jars (while all are selected), select the "Build Path" sub-menu and select "Add to Build Path"
- Setup a solr home folder inside your project. For purposes of this tutorial, copy the "solr" folder from the "example/" folder in the directory containing solr into the "TestSolr" folder in your Eclipse workspace. By now, your "TestSolr" project layout should look something like this.
Step Four: Let's run this thing!
Now that you have setup your project, it's time to create a run configuration for Jetty and run this!
In Eclipse, go to the Run menu and select "Run Configurations...".
- On the left rail, you should see "Jetty Webapp" as one of the run configuration types. Right click on this and select "New". The project should be "TestSolr" (if not, type in TestSolr in the text box labeled with "Project"). The name of the run configuration is populated with "TestSolr" and can be whatever you wish.
- The default HTTP port is 8080 and can be left alone if you wish. To conform to Solr tutorials (making copying/pasting links easier, change this to 8983). Delete the HTTPs port 8443 since we aren't doing any SSL access. This will disable the SSL specific fields such as the keystore/password fields.
- Change the "context" to "/solr" from "/". This is more for conformity with the solr tutorials in that all links in the wiki you to something like http://localhost:8983/solr/
- Type in "webapp" in the "WebApp dir" text box. This is the root of the web application and is the directory above the WEB-INF folder. This is where the solr war file was extracted and hence is the equivalent of deploying the solr war in your servlet container.
Your launch configuration should look like the following:
Now click the "Run" button which will save the changes and the console will hopefully start spewing out logs produced by both Jetty and Solr. Open a browser to http://localhost:8080/solr/admin/ and voila! you should see the Solr admin page. In scrolling through the console, you shouldn't see any exceptions thrown.
This simple tutorial just shows the basics of setting up a simple solr installation inside Eclipse using Jetty and running inside Eclipse. Notice that we don't have any of our own code running that may do some extra things (say custom analyisis, tokenizing etc). If we did have such code, then it would naturally lie in the "src/" folder; however, we need to instruct Eclipse to compile the code so that it goes in the WEB-INF/classes folder so it will run inside Jetty. To do this:
- Right click on the TestSolr project and select "Properties".
- Click on the "Java Build Path" on the left rail
- Click on the "Source" tab and towards the bottom, change the default output folder to be "TestSolr/webapp/WEB-INF/classes".
Now you can develop your custom solr plugins directly in Eclipse and debug them immediately. Instead of running the TestSolr jetty instance, you can launch it in debug mode by going to the Run Menu and opening the "Debug Configurations.." sub-menu, selecting the Jetty configuration created earlier and click the "Debug" button. I would encourage familiarizing yourself with Eclipse's debugging capabilities for they are vast and amazing.
发表评论
-
pageRank计算公式的由来
2011-10-05 14:10 2112经常看到各种介绍pageran ... -
Sphinx Mysql Full-Search速成指南
2011-08-26 11:41 842Sphinx Mysql Full-Searc ... -
mahout在eclipse下的开发环境
2011-07-30 11:27 4794首先将源码转移到~/workspace下,目标文件夹为maho ... -
mahout安装配置
2011-07-27 20:41 1655http://log.medcl.net/item/2011/ ... -
通过实际应用学习hadoop
2011-05-15 18:58 0我首先从ivory这个开源的信息检索研究工具开始研究,对它感兴 ... -
备份记录
2011-04-06 09:13 755/nutch-1.2做了一个备份到~/petrelli/nut ... -
nutch的配置文件理解
2011-03-21 11:55 1179nutch的配置文件我们可以从Crawl.java中看起,在m ... -
自己安装的路径
2011-03-14 22:03 9901,今天在利用nutch和solr集成的环境建立索引时,bin ... -
集成nutch和solr,并加入中文分词的过程
2011-03-04 16:51 9584准备工作 安装nutch 安装solr 加入中文分词 ... -
使用 solr搭建你的全文检索(转)
2011-03-01 09:02 981Solr 是一个可供企业使用的、基于 Lucene 的 ... -
solr配置相关
2011-02-26 14:57 1049首先去官方网站看了一下solr的tutorial文档,里面给出 ... -
推荐的一些想法
2010-11-02 16:29 1029在读写网一篇评论推荐 ... -
少数人的智慧(The Wisdom of the Few) (转)
2010-10-12 20:26 976看 到这么个有吸引力的名字,你不会觉得它是一篇学术论文,但实际 ... -
基于LUCENE实现自己的推荐引擎(转)
2010-10-01 23:37 9281、常用推荐引擎算法问题 1)、相对成熟、完整、现成的开源解 ... -
海量数据分析:Sawzall并行处理(中文版论文)
2010-08-24 16:37 1846Google的工程师为了方便 ... -
Google的十大核心技术
2010-08-20 17:32 835Google的十大核心技术 作 ... -
MapReduce 中文版论文
2010-08-20 16:51 1222MapReduce 中文版论文 作 ...
相关推荐
Apache Solr 4 Cookbook Apache Solr 4 Cookbook Apache Solr 4 Cookbook Apache Solr 4 Cookbook Apache Solr 4 Cookbook
Spring Data for Apache Solr API。 Spring Data for Apache Solr 开发文档
Apache Solr是一款开源的企业级搜索平台,由Apache软件基金会维护。它是基于Java的,提供了高效、可扩展的全文检索、数据分析和分布式搜索功能。Solr-8.11.1是该软件的一个特定版本,包含了从早期版本到8.11.1的所有...
Apache Solr 是一个开源的全文搜索引擎,由Apache软件基金会维护,是Lucene项目的一部分。它提供了高效、可扩展的搜索和导航功能,广泛应用于企业级的搜索应用中。Solr-8.11.1是该软件的一个特定版本,包含了最新的...
这两本电子书——"Apache Solr High Performance.pdf" 和 "Solr In Action 2013.pdf" 提供了深入的Solr知识,帮助读者理解和优化Solr的性能。 "Apache Solr High Performance"可能涵盖了如何最大化Solr的性能,包括...
Apache Solr是一个基于Apache Lucene构建的开源搜索平台。它是一个高性能的企业级搜索引擎,专为全文搜索和搜索应用程序而设计。Solr提供了可扩展、容错和分布式的特点,同时提供了多种接口,包括REST API,使其可以...
Apache Solr Essentials is a fast-paced guide to help you quickly learn the process of creating a scalable, efficient, and powerful search application. The book starts off by explaining the ...
apache solr搜索系统的.Net实现
### Apache Solr 6.2.1 搜索引擎:从部署到实际应用 #### 一、概述 Apache Solr 是一款高性能的企业级搜索平台,它基于 Lucene 构建,支持 RESTful API,并且能够处理高流量场景。Solr 提供了广泛的特性,包括全文...
Leverage the power of Apache Solr to power up your business by navigating your users to their data quickly and efficiently About This Book Learn the best use cases for using Solr in e-commerce, ...
Apache Solr 是一个开源的企业级搜索平台,由Apache软件基金会维护。版本3.6.1是Solr的一个重要里程碑,提供了稳定性和性能优化。通过深入理解这个版本的源代码,开发者可以更深入地掌握Solr的工作原理,从而更好地...
### Apache Solr Guide 4.7 知识点解析 #### 一、Apache Solr 概述 **Apache Solr** 是一个高性能、基于 Lucene 的全文检索服务系统,广泛应用于互联网企业的搜索服务中。Solr 提供了高度可扩展且稳定的搜索功能,...
### Apache Solr Search:一种强大的开源企业搜索解决方案 #### Apache Solr简介 Apache Solr是一款基于Lucene Java搜索引擎库的企业级搜索服务器。它不仅继承了Lucene的强大功能,还在此基础上进行了扩展,提供了...
标题中的“Solr in Action -- Apache Solr 在比价系统中的应用”表明本文将深入讨论Apache Solr搜索服务器在比价系统中的实际应用案例。Apache Solr是一个开源的搜索引擎平台,广泛应用于企业级应用中,以提高搜索...
### Apache Solr 7.x Mastering Guide:提升、优化与扩展企业级搜索技术详解 #### 知识点一:Apache Solr 7.x 概览 - **版本更新要点**:本书聚焦于Apache Solr 7.x版本的核心特性和新增功能,包括性能提升、稳定性...
Apache Solr是Apache软件基金会的一个开源项目,是一个全文搜索引擎服务器,设计用于处理大规模数据集,提供高效的搜索和分析功能。《Apache Solr 7官方指南》是为了解析和掌握这个强大工具的重要参考资料,旨在帮助...