Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to add documents in solrj

Shulou Source: shulou.com Published: 2022-05-31 18:43:23 10月03日 Update

Editor to share with you how to add documents in solrj, I hope you have something to gain after reading this article, let's discuss it together!

String urlString = "http://localhost:8983/solr/techproducts";SolrClient solr = new HttpSolrClient (urlString); SolrInputDocument document = new SolrInputDocument (); document.addField (" id "," 552199 "); document.addField (" name "," Gouda cheese wheel "); document.addField (" price "," 49.99 "); UpdateResponse response = solr.add (document); / / submit after adding multiple times, solr.commit ()

Note: ConcurrentUpdateSolrClient is recommended on official documents to perform update operations on a large number of documents.

After reading this article, I believe you have a certain understanding of "how to add documents in solrj". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Documents articles finished official suggestions more knowledge industry information information channels channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker vpn Shulou Tech Info OPPO Reno NVidia