网站大量收购闲置独家精品文档,联系QQ:2885784924

第9讲 Solrj之Multicore查询培训课件.ppt

  1. 1、本文档共7页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
北风网项目实战培训 创建Multicore 1、复制D:\work\solr_home\test,命名为core。 2、修改D:\work\solr_home\test\ perties name=test config=solrconfig.xml schema=schema.xml dataDir=data 改成: name=core1 3、重启tomcat 添加索引 向每个core添加索引: 修改private static String url=http://localhost:8081/solr/test; 每次添加不同core只需要修改test即可,也可以以参数将core传入。 添加索引的方法跟上节将的方法一样,在此就不再累述了。 Multicore 查询 HttpSolrClient server = SolrServer.getServer(); SolrQuery sQuery = new SolrQuery(); sQuery.setQuery(str); sQuery.setStart(0); sQuery.setRows(5); sQuery.set(shards, localhost:8081/solr/test,localhost:8081/solr/core1,localhost:8081/solr/core2); QueryResponse queryResponse; try { queryResponse = server.query(sQuery); ListTestBO indexBOLists = queryResponse.getBeans(TestBO.class); for (TestBO bo : indexBOLists) { System.out.println(bo.getDes_s()); } } catch (Exception e) { e.printStackTrace(); } 管理页面安全设置(一) 仅针对tomcat: 1、修改G:\solr5\apache-tomcat-8.0.28\conf\tomcat-users.xml 在tomcat-users标签内添加: role rolename=solr/ user username=admin password=admin roles=solr/ 2、修改G:\solr5\apache-tomcat-8.0.28\webapps\solr\WEB-INF\web.xml security-constraint web-resource-collection web-resource-nameRestrictaccesstoSolradmin/web-resource-name url-pattern/admin/*/url-pattern http-methodDELETE/http-method http-methodGET/http-method 管理页面安全设置(二) http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint descriptionThis applies only to the tomcat security role/description role-namesolr/role-name role-nameadmin/role-name /auth-constraint user-data-constraint transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint login-config auth-methodBASIC/auth-method realm-nameplease input user and password./realm-name /login-config 欢迎访问我们的官方网站

文档评论(0)

a13355589 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档