当前位置: 首页 > news >正文

怎样查找网站域名归属网站制作目的

怎样查找网站域名归属,网站制作目的,北京建设网服务大厅,wordpress安装到阿里云主机学习了一下https://github.com/TyCoding/ssm-redis-solr这个github上的solr搜索功能#xff0c;现在来记录一下。 我的理解就是solr有点类似于数据库#xff0c;但它是有索引的数据库#xff0c;按很多字段建立索引#xff0c;可能是b树或者散列索引#xff0c;然后就能够…  学习了一下https://github.com/TyCoding/ssm-redis-solr这个github上的solr搜索功能现在来记录一下。 我的理解就是solr有点类似于数据库但它是有索引的数据库按很多字段建立索引可能是b树或者散列索引然后就能够实现海量数据的查找。solr通过导入jar包就可以对这个库就行增删改查了后端逃不掉的增删改查。。。  1.配置tomcat 具体我就不说了因为我是直接用了github上配置好的毕竟站在巨人的肩膀上学习嘛 地址https://github.com/TyCoding/solr-tomcat 2.访问solr并使用 访问端口:localhost:8080/solr/index.html 这里的new_core就是项目中配置的路径就将商品的索引放在这里。 然后用Test测试它的使用测试的时候要引入配置文件不然会导致空指针错误我居然现在才知道。怪不得以前只要用Autowired的时候就会空指针错误。。而且还要Runwith注解引入包import org.springframework.test.context.junit4.*;eclipse点击不会有import提示需要自己加上去。    这里新建了一个实体对象然后把这个实体对象加入到索引库里在solr索引库里面就可以找到这个字段 在new_core的schema里面就以Id建好了索引 以及很多的信息 Testpublic void testFindById() {Goods goods solrTemplate.getById(1, Goods.class);System.out.println(-------- goods.getTitle());} 通过id查找控制台会输出你刚刚插入的数据也就是通过solrTemplate找到了你的数据。 Testpublic void testAddList() {ListGoods list new ArrayListGoods();//循环插入100条数据for (int i 0; i 100; i) {BigDecimal pricenew BigDecimal (2.3);Goods goods new Goods(i 1L, 华为Mate i,price, 手机, 手机, 华为专卖店);list.add(goods);}solrTemplate.saveBeans(list); //添加集合对象调用saveBeans()添加普通对象类型数据使用saveBean();solrTemplate.commit(); //提交} 还可以批量插入数据或者分页查询 Testpublic void testPageQuery() {Query query new SimpleQuery(*:*);query.setOffset(20); //开始索引默认0query.setRows(20); //每页记录数默认10ScoredPageGoods page solrTemplate.queryForPage(query, Goods.class);System.out.println(总记录数 page.getTotalElements());ListGoods list page.getContent();} 3.学习一下项目中怎么配置 注意要在web.xml加一个过滤不然注入不了solrTemplate这个bean   spring-solr.xml ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:solrhttp://www.springframework.org/schema/data/solrxsi:schemaLocationhttp://www.springframework.org/schema/data/solrhttp://www.springframework.org/schema/data/solr/spring-solr-1.0.xsdhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- solr服务器地址 --solr:solr-server idsolrServer urlhttp://127.0.0.1:8080/solr/new_core/!-- solr模板使用solr模板可对索引库进行CRUD的操作 --bean idsolrTemplate classorg.springframework.data.solr.core.SolrTemplateconstructor-arg refsolrServer//bean/beans 就是加载一个solr的模板   SolrUtil.java 把数据库的数据库批量加入 Component public class SolrUtil {Autowiredprivate GoodsMapper goodsMapper;Autowiredprivate SolrTemplate solrTemplate;/*** 实现将数据库中的数据批量导入到Solr索引库中*/public void importGoodsData() {ListGoods list goodsMapper.findAll();System.out.println(商品列表);for (Goods goods : list) {System.out.println(goods.getTitle());}solrTemplate.saveBeans(list);solrTemplate.commit(); //提交System.out.println(结束);}public static void main(String[] args) {ApplicationContext context new ClassPathXmlApplicationContext(classpath:spring/spring*.xml);SolrUtil solrUtil (SolrUtil) context.getBean(solrUtil);solrUtil.importGoodsData();} }    这样就把数据加入索引库中。 实体类有一个Field标识这个实体字段在索引库里的名称 Fieldprivate Long id; //商品IDField(item_title)private String title; //商品标题Field(item_price)private BigDecimal price; //商品价格Field(item_image)private String image; //商品图片Field(item_category)private String category; //商品类别Field(item_brand)private String brand; //商品品牌Field(item_seller)private String seller; //商品卖家 最后搜索功能的实现 按价格查找 //按价格区间查询if (searchMap.get(price) ! null) {if (!searchMap.get(price).equals()) {String[] price ((String) searchMap.get(price)).split(-);if (!price[0].equals(0)) {//如果起点区间不等于0Criteria filterCriteria new Criteria(item_price).greaterThanEqual(price[0]);FilterQuery filterQuery new SimpleFilterQuery(filterCriteria);query.addFilterQuery(filterQuery);}if (!price[1].equals(*)) {//如果区间重点不等于*Criteria filterCriteria new Criteria(item_price).lessThanEqual(price[1]);FilterQuery filterQuery new SimpleFilterQuery(filterCriteria);query.addFilterQuery(filterQuery);}}}  4.实现效果  转载于:https://www.cnblogs.com/HannahLihui/p/10104416.html
http://www.yutouwan.com/news/231394/

相关文章:

  • 企业网站备案座机号轻媒做的网站
  • 珠海建设集团网站首页开网络公司做网站挣钱么
  • 软件介绍网站源码手机百度搜索app
  • 广饶网站建设wordpress 微信绑定
  • 网站如何做流量赚钱学电子商务有前途吗
  • 网站默认极速模式如何给网站做404页面
  • 潍坊微信网站wordpress 阅读主题
  • 商务型网站建设个人博客主页
  • 网站建设与维护试卷及答案安徽建设网
  • 做一张网站图多少钱旅游门户网站有哪些
  • 国内外知名建设设计网站网站标题怎么写
  • 免费营销型网站建设北京城乡建设部网站首页
  • 有没有哪个网站免费做简历的重庆网站产品推广
  • 开办网站原因h5网站作用
  • 网站如何自己做支付wordpress短视频主题
  • 青岛建站合作网站seo优化发布高质量外链
  • 数据展示网站模板百度站长工具网站
  • 网站突然显示 建设中河北大名网站建设招聘
  • 网站图片管理系统石家庄专业网站建设
  • 网站管理员可控的关键节点wordpress设置菜单导航
  • 厦门做网站 厦门专业做网站的公司 我想做网站辽宁建设工程信息网直接发包工程
  • 有免费做门户网站吗手机wap 网站
  • 网站运营的概念青岛品牌设计
  • 用网站做自我介绍ftp如何上传网站
  • 晋州市建设局网站舞台灯光网站建设公司
  • 建设婚恋网站基本功能有哪些中国互联网协会副理事长
  • 海东营销网站建设上海市民营企业100强
  • 如何让百度搜索到自己的网站wordpress转typecho插件
  • 用wordpress仿一个网站模板濮阳专业做网站公司
  • 长沙大型网站建设公司怎么用ps做网站