“This is the fifth day of my participation in the November Gwen Challenge. See details of the event: The Last Gwen Challenge 2021”.

1. What is Solr?

Solr is an independent enterprise search application server that provides an API interface similar to Web Service. Users can submit XML files in a certain format to search engine servers through HTTP requests to generate indexes. You can also make a lookup request through an Http Get operation and Get the result back in XML format.

2. How did Solr come about?

Solr is apache’s top open source project. It is a full-text search server developed in Java and based on Lucene.

What does Solr have more than Lucene?

  • What is Lucene?

Lucene is a full text search engine toolkit, it is only a JAR package, can not run independently, external services.

  • Solr advantages

Solr is a full-text search server that can run on its own in a servlet container or provide search and indexing functions externally. Solr is faster and more convenient than Lucene in developing full-text search functions. Solr provides more query statements than Lucene, it is extensible, configurable, and it optimizes Lucene’s performance.

4. How does Solr achieve full text retrieval?

  • Indexing process

Solr clients (browsers, Java programs) can send POST requests to Solr servers. The request content is an XML document containing Field information, through which Solr implements index maintenance (adding, deleting, modifying).

  • The search process

The Solr client (browser, Java program) can send a GET request to the Solr server, which returns an XML/JSON document.

5. How to download and launch Solr?

Note: Solr and Lucene are updated at the same time. The latest version is 8.1.0

Download address: mirrors.tuna.tsinghua.edu.cn/apache/luce…

Download: Based on the Solr operating environment, you need to download solR-8.1.0. TGZ for Linux and solR-8.1.0.zip for Windows.

Description:

  1. Src. TGZ: indicates a compressed package with source files. If no SRC indicates a compressed package that has been compiled
  2. TGZ: compressed package used by Linux operating systems
  3. Zip: compressed package for Windows operating system

Start the Solr:

Solr start, stop, view commands:

  1. Start: bin\solr. CMD start
  2. Stop: bin\solr stop or bin\solr stop-all
  3. View: bin\solr status

 

Visit address:http://localhost:8983/solr/#/

6.Solr performance optimization

  • Stored is set to false for all fields that are only used for searching and don’t need to be used as results

  • Sets the indexed set to false for field that doesn’t need to be used for searching, but is just returned as a result

  • Remove all unnecessary copyField declarations

  • To minimize index fields and search efficiently, set the index of all text fields to field, then use a copyField to copy them to a total text field and search.

  • To maximize search efficiency, clients written in Java interact with Solr

  • Run the JVM on the server side and use the highest possible Log output level to reduce the amount of logging.

conclusion

After a general understanding of Solr, we know that it supports more data formats, such as JSON, XML, CSV; Fast query, used for e-commerce and other query applications; Mature, with a larger, more mature community of users, developers, and contributors.