摘要: 启动示例程序:下载最新版solr,解压,控制台进入解压目录下的examle目录 ,执行start.jar(控制台输入: java -jar start.jar)访问http://localhost:8983/solr/admin/Solr栏:SCHEMA链接schema.xml配置文件,schema配置文件声明文档的fields 属性,类型CONFIG链接solrconfig.xml配置文件,solrconfig配置文件负责solr本身的设置,比如缓存,处理器,等等。ANALYSIS分析器配置文件。LOGGING设定日志记录级别 。其他参见http://www.ibm.com/develope 阅读全文
posted @ 2012-01-19 17:03 HelloCoding 阅读(246) 评论(1) 推荐(0) 编辑
摘要: 在 Solr 和 Lucene 中,使用一个或多个 Document 来构建索引。Document 包括一个或多个 Field。Field 包括名称、内容以及告诉 Solr 如何处理内容的元数据。例如,Field 可以包含字符串、数字、布尔值或者日期,也可以包含您想添加的任何类型。Field 可以使用大量的选项来描述,这些选项告诉 Solr 在索引和搜索期间如何处理内容。主要是这两个属性。一个索引示例浏览到 http://localhost:8080/dw/index.jsp 可以查看索引过程的更多细节。首先为表单中的每个字段填入适当的条目并按 Submit 按钮。示例应用程序接受条目、创建 阅读全文
posted @ 2012-01-19 17:03 HelloCoding 阅读(270) 评论(0) 推荐(0) 编辑
摘要: a. 比较 addon simple 和addon advanced区别 addon simple 只有两个相关点,一个command ,一个operation,简单说就是提供命令,还有命令对应的操作,利用roo提供的工具类完成对应操作。b.Roo核心各部分关系c.主要模块功能:Support— Theorg.springframework.roo.supportmodule provides common utility classes used by all the core modules and add-ons. Some utility classes includeAssert,F 阅读全文
posted @ 2012-01-19 17:02 HelloCoding 阅读(182) 评论(0) 推荐(0) 编辑
摘要: roo> solr setup向工程添加solr支持~.Person roo> solr add 通过AOP为Person类添加支持全文索引的方法privileged aspect Person_Roo_SolrSearch { @Autowired transient SolrServer Person.solrServer;//简单查询 public static QueryResponse Person.search(String queryString) { return search(new SolrQuery("person.solr... 阅读全文
posted @ 2012-01-19 17:02 HelloCoding 阅读(464) 评论(0) 推荐(0) 编辑
摘要: 索引操作在 Solr 中,通过向部署在 servlet 容器中的 Solr Web 应用程序发送 HTTP 请求来启动索引和搜索。Solr 接受请求,确定要使用的适当SolrRequestHandler,然后处理请求。通过 HTTP 以同样的方式返回响应。默认配置返回 Solr 的标准 XML 响应。您也可以配置 Solr 的备用响应格式。我将在本文的第 2 部分向您展示如何定制请求和响应处理。索引就是接受输入(本例中是博客条目、关键字和其他元数据)并将它们传递给 Solr,从而在HTTP PostXML 消息中进行索引的过程。您可以向 Solr 索引 servlet 传递四个不同的索引请求: 阅读全文
posted @ 2012-01-19 17:02 HelloCoding 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 1、spring roo 默认语言如何设置参见 Roo默认语言调试将\src\main\webapp\WEB-INF\i18n\messages.properties中得内容和messages_cn中得内容替换,另外新建一个messages_en.properties就一切正常了.之前给出的答案错了,请谅解.测试时没有清空缓存.2、entity 中的field如何设置默认值 by Jimmy默认值 --value 设置field属性 一直tab value 比较可能,试了试就是他 阅读全文
posted @ 2012-01-19 17:01 HelloCoding 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1.点击有向下小三角的按钮2.点左上角,的+号,选择Maven3.在Name栏,随便填点东西,working directory 选择你的当前maven工程 Goals栏 写tomcat:run 然后 ok.4.点绿色的小三角,你的项目就用maven里的tomcat插件运行了. 阅读全文
posted @ 2012-01-19 17:00 HelloCoding 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 解决办法:找到STS安装目录,进入修改STS.in文件将红色部分改为你jdk的真实路径-vmC:/pccw/Java/jdk1.6/bin/javaw.exe-startupplugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.wi... 阅读全文
posted @ 2012-01-19 16:59 HelloCoding 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 1.为什么要使用Maven,使用Maven有什么好处maven是一个可以帮助你进行项目编译、文档管 理、报告管理、包依赖管理、SCMs管理、发布等的工具.它可以协助你完成以下工作:1.快速创建一个工程文件2.几乎不用做任何设置, 可以立即进行编译、测试、打包等工作。以前用Ant的时候,也可以很方便的做这些工作,但是写Ant的build.xml文件是一件很烦琐的事情。3. 创建项目文档非常容易,可以自动生成一个web site,记录你的项目情况、版本信息、两个版本之间的change list等。4.非常方便 的远程发布、scm(cvs)管理功能。5.依赖管理功能。2 有maven前后对比有mav 阅读全文
posted @ 2012-01-19 16:54 HelloCoding 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 原因:IDE开发中,对于实体包类的引用超过几个,会自动变成*(例如 import com.entity.*;)roo无法正确识别, 会报 Unable to obtain physical type metdata for XX类,解决:将工程中对实体类的引用的*,换成具体类名 阅读全文
posted @ 2012-01-19 16:53 HelloCoding 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 配置文件中已配置IK分词器,与分词器关联类型为text除将subject配置为<uniqueKey>subject</uniqueKey> (必须为solr.StrField类型,所以配置为string)<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>配置详情:<fieldType name="text" class=" 阅读全文
posted @ 2012-01-19 16:43 HelloCoding 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 如果没有使用maven:solrj3.4要导入以下jar包到classpath使用maven比较简单 <dependency> <artifactId>solr-solrj</artifactId> <groupId>org.apache.solr</groupId> <version>3.4.0</version> <type>jar</type> <scope>compile</scope> </dependency>以上所有jar包可以... 阅读全文
posted @ 2012-01-19 16:42 HelloCoding 阅读(249) 评论(0) 推荐(0) 编辑
摘要: A.Linux环境1、将example/solr下的内容拷贝到/opt/solr/example(下文用$SOLR_HOME代替),将example/webapps/solr.war拷贝到$SOLR_HOME2、编辑$SOLR_HOME/conf/solrconfig.xml,修改dataDir<dataDir>${solr.data.dir:/opt/solr/example/data}</dataDir>或者可以修改tomcat的启动脚本exportJAVA_OPTS="$JAVA_OPTS-Dsolr.data.dir=/opt/solr/example 阅读全文
posted @ 2012-01-19 16:42 HelloCoding 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 将附件中的IKAnalyzer.cfg.xml内容更改,指向扩展自定义扩展词典的位置<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>IK Analyzer 扩展配置</comment><!--用户可以在这里配置自己的扩展字典<entry key=" 阅读全文
posted @ 2012-01-19 16:41 HelloCoding 阅读(1343) 评论(0) 推荐(0) 编辑
摘要: java -jar post.jar *.xml java -Ddata=args -jar post.jar '<delete><id>42</id></delete>' java -Ddata=stdin -jar post.jar < hd.xml java -Durl=http://localhost:8983/solr/update/csv -Dtype=text/csv -jar post.jar*.csv java -Durl=http://localhost:8983/solr/update/json -Dt 阅读全文
posted @ 2012-01-19 16:41 HelloCoding 阅读(1007) 评论(0) 推荐(0) 编辑
摘要: Vaadin Plugin for Spring RooSpring Roo is a lightweight developer tool that makes it fast and easy to deliver instant results. Best of all, you code 100% in Java and get to reuse all your existing Java knowledge, skills and experience.注意:vaadin目前只支持SpringRoo1.1.5,Install SpringSource Tool Suite (STS 阅读全文
posted @ 2012-01-19 16:38 HelloCoding 阅读(1080) 评论(0) 推荐(0) 编辑
摘要: vaadin应用程序的开发类似于桌面应用的开发。5分钟教程:首先要有一个主程序入口(继承com.Vaadin.Application),实现init方法(类似main方法)代码示例: import com.Vaadin.Application; import com.Vaadin.ui.*; public class Dw_Vaadin_projectApplication extends com.Vaadin.Application { public void init() { /*... 创建主窗口 ...*/ Window main = new Window(... 阅读全文
posted @ 2012-01-19 16:36 HelloCoding 阅读(1868) 评论(0) 推荐(0) 编辑
摘要: CasServer配置:1.用keytool 生成 CasServer 所在主机的证书(keystore),并导出(crt文件)。2.配置Tomcat server.xml 指明证书位置CasClient配置:将CasServer所在主机证书导入CasClient主机jre的受信目录Casclient应用导入依赖文件。配置web.xml,添加过滤器注意:web.xml 请求地址的配置。web.xml 配置:<!-- ======================== 单点登录开始 ======================== --><listener><list 阅读全文
posted @ 2012-01-19 16:35 HelloCoding 阅读(264) 评论(0) 推荐(0) 编辑
摘要: Debugging Roo addon is like debugging remote Java application. Get Roo source code from Roo Git repositoryCompile it with 'mvn clean install'Open the file '%ROO_HOME%\bootstrap\roo-dev.bat' in your favorite text editorAdd the following line somewhere above the line 'rem Hop, hop, 阅读全文
posted @ 2012-01-19 16:31 HelloCoding 阅读(333) 评论(0) 推荐(0) 编辑