Solr development and indexing data submission methods

Source: Internet
Author: User




Solution 1: Custom Conversion Mechanism Using Reflection

      (obj != <?> cls == cls.getDeclaredFields();                                    Method m = =                 (!f.getName().equals("serialVersionUID"                        String dynamicGetMethod = dynamicMethodName(f.getName(), "get"                        m =                        LOG.info(f.getName() + ":" +""+"Object to convert is null." 

      <T>  addConvertBeans(SolrServer server, List<T>, "Add convert object list to index finished. ""Add convert object list to index error, " +      <T>  addConvertBeans(SolrServer server, List<T>, "Add convert object list to index finished. ""Add convert object list to index error, " +

= <String> title = ArrayList <String> "I pretend after the door that you haven't taken" "Jay Chou" <Article> lists = ArrayList <Article >=< String> atlts1 = ArrayList <string> "No regrets when you say goodbye, hanyue Qing Xiaoyi dream back "" I know that I am in love, the dust is not a total of colorful clouds flying "" Liu mengyu "= <String> atlts2 = ArrayList <String>" Xiao Xiaoqu has nowhere to complain; for Yi, happy. "" Why is it that people are imaginary? If you want to share your thoughts, you will not be able to receive them. "" Liu mengmiao"

Method 2: Use the annotation mechanism provided by solr

  Article         serialVersionUID = 4017316764889231758L"id""title" List<String> String author;                     .id = .author = List<String>  setTitle(List<String>.title = ToStringBuilder.reflectionToString(
  Article         serialVersionUID = 4017316764889231758L"id""title" List<String> String author;                     .id = .author = List<String>  setTitle(List<String>.title = ToStringBuilder.reflectionToString(

      ,"Add object to index finished.""Add object to index error, " +      <T>  addBeans(SolrServer server, List<T>, "Add object list to index finished. ""Add object list to index finished. "

= <String> title = ArrayList <String> "map: Qingdao, the last islands. "" su ruonian "<Article> lists = ArrayList <Article >=< String> atlts1 = ArrayList <String>" No regrets when you say goodbye, hanyue Qing Xiaoyi dream back "" I know that I am in love, the dust is not a total of colorful cloud flying "" suruonian "= <String> atlts2 = ArrayList <String>" Xiao xiaoxunqu nowhere to complain; it is an easy task. "" Why is it that people are imaginary? If you want to share your thoughts, you will not be able to receive them. "" Liu mengmiao"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.