zoukankan      html  css  js  c++  java
  • sth about solr and other opensource utils

    solr

    1 drill data by random,eg.&random_123

     solrQuery.addSortField("random_"+rand.nextInt(1000),SolrQuery.ORDER.desc);

    2  search id not equal to 222

     eg.-id:222

    3 deleteById(List<String> ids) in solrj

      we should delete anything by id As much as possible,using deleteByQuery function may occur some problem.

    4 to get facet result we need to set facet and facet.field,also rows=0 is needed

    5 if you use dismax to search,you should use q="val" instead of q="title:val"

    6 highlight  params : &hl=true&hl.fl=title

    7 show score params :&fl=score ,useful  score will  spread out before us when you search some words

    8 delete url

       update/?stream.body=<delete><id>mm</id></delete>&stream.contentType=text/xml;charset=utf-8&commit=true

    9 clear update docs

      after we commit docs,we need to use "this.docs.clear()"  to clear the queue stored docs

    10 optimize

      optimizing one time per day is a good choice

    11 get all the data which field value's length >0

       q=fieldName:["" To *]

    12 use underline' can replace the default operator

       SolrQuery.setParam("q.op", "OR");

    13 use dismax+qf to search instead of default text

    14 url complex/analysis/field?q=param to get split words

    15 if use mm, %25 is needed after urllink


    16 query with q only will get better performance than 'q&fq'

    json util

         we often use net.sf.json and org.json.simple to help us do explaining,on use we found some string cannot  be decoded well by  net.sf.json ,

    so  org.json.simple is good complement .After import org.json we may use JSONParser to change string to JSONObject.

      For importing  net.sf.json,we may change list object to JSONArray,and decode json text to json object 

    and then use a function(JSONObject.toBean(jsonObj,className)) to convert jsonObj to class object

        

  • 相关阅读:
    Lambda+Stream替换集合中每个对象的指定字段值
    bootstrap table的属性sidePagination设置不当导致数据不显示
    fullcalendar从后台获取events报Uncaught TypeError: callback is not a function
    com.sun.mail.smtp.SMTPSendFailedException: 550 Invalid User
    js中复制功能的实现
    List列表排序报空指针异常
    springboot+tomcat不同环境采用不同配置文件
    装饰模式
    Ambari和大数据集群部署(精华)
    Ambari安装和汉化(转)
  • 原文地址:https://www.cnblogs.com/ai464068163/p/2375468.html
Copyright © 2011-2022 走看看