Apache Solr Q&A

[vc_row][vc_column css_animation=”fadeInLeft”][vc_column_text css=”.vc_custom_1562584778461{background-color: #1e73be !important;}”]

Apache Solr Interview Questions & Answers

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column css_animation=”fadeInLeft” width=”1/2″][vc_tta_accordion color=”peacoc” active_section=”1″][vc_tta_section title=”Compare Solr & ElasticSearch” tab_id=”1562584797463-e7ebb42f-0700″][vc_column_text]

Criteria Solr ElasticSearch
Data varieties JSON, XML, CSV JSON
Data de duplication Supported Not supported
Updates Through configuration changes Through custom work

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is Apache Solr?” tab_id=”1562584797481-7583756d-221d”][vc_column_text]

Apache Solr is a standalone full-text search platform to perform searches on multiple websites and index documents using XML and HTTP. Built on a Java Library called Lucence, Solr supports a rich schema specification for a wide range and offers flexibility in dealing with different document fields. It also consists of an extensive search plugin API for developing custom search behavior.

[/vc_column_text][/vc_tta_section][vc_tta_section title=” What file contains configuration for data directory?” tab_id=”1562584816228-7b68045f-4eff”][vc_column_text]

Solrconfig.xml file contains configuration for data directory.

[/vc_column_text][/vc_tta_section][vc_tta_section title=” What file contains definition of the field types and fields of documents?” tab_id=”1562584817545-fb5c023c-3f26″][vc_column_text]

schema.xml file contains definition of the field types and fields of documents.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What are the features of Apache Solr?” tab_id=”1562584818084-9ebd0afe-4328″][vc_column_text]

  • Allows Scalable, high performance indexing Near real-time indexing.
  • Standards-based open interfaces like XML, JSON and HTTP.
  • Flexible and adaptable faceting.
  • Advanced and Accurate full-text search.
  • Linearly scalable, auto index replication, auto failover and recovery.
  • Allows concurrent searching and updating.
  • Comprehensive HTML administration interfaces.
  • Provides cross-platform solutions that are index-compatible.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is Apache Lucene?” tab_id=”1562584818689-3ca861ff-1248″][vc_column_text]

Supported by Apache Software Foundation, Apache Lucene is a free, open-source, high-performance text search engine library written in Java by Doug Cutting. Lucence facilitates full-featured searching, highlighting, indexing and spellchecking of documents in various formats like MS Office docs, HTML, PDF, text docs and others.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is request handler?” tab_id=”1562584819255-ad819614-6947″][vc_column_text]

When a user runs a search in Solr, the search query is processed by a request handler. SolrRequestHandler is a Solr Plugin, which illustrates the logic to be executed for any request.Solrconfig.xml file comprises several handlers (containing a number of instances of the same SolrRequestHandler class having different configurations).

[/vc_column_text][/vc_tta_section][vc_tta_section title=” What are the advantages and disadvantages of Standard Query Parser?” tab_id=”1562584819867-76e3721e-5244″][vc_column_text]

Also known as Lucence Parser, the Solr standard query parser enables users to specify precise queries through a robust syntax. However, the parser’s syntax is vulnerable to many syntax errors unlike other error-free query parsers like DisMax parser.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What all information is specified in field type?” tab_id=”1562584820467-cff1ec51-7627″][vc_column_text]A field type includes four types of information:

  • Name of field type.
  • Field attributes.
  • An implementation class name.
  • If the field type is Text Field , a description of the field analysis for the field type.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Explain Faceting in Solr.?” tab_id=”1562584821086-c1de40d4-1350″][vc_column_text]

As the name suggests, Faceting is the arrangement and categorization of all search results based on their index terms. The process of faceting makes the searching task smoother as users can look for the exact results.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Define Dynamic Fields?” tab_id=”1562584822141-eb369600-a593″][vc_column_text]

Dynamic Fields are a useful feature if users by any chance forget to define one or more fields. They allow excellent flexibility to index fields that have not been explicitly defined in the schema.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is Field Analyzer?” tab_id=”1562584822999-7b654cdd-4dcd”][vc_column_text]Working with textual data in Solr, Field Analyzer reviews and checks the filed text and generates a token stream. The pre-process of analyzing of input text is performed at the time of searching or indexing and at query time. Most Solr applications use Custom Analyzers defined by users. Remember, each Analyzer has only one Tokenizer.[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the use of tokenizer?” tab_id=”1562584823623-5f177321-771d”][vc_column_text]

It is used to split a stream of text into a series of tokens, where each token is a subsequence of characters in the text. The token produced are then passed through Token Filters that can add, remove or update the tokens. Later,that field is indexed by the resulting token stream.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is phonetic filter?” tab_id=”1562584824252-f5c3d061-cc0d”][vc_column_text]

Phonetic filter creates tokens using one of the phonetic encoding algorithms in the org.apache.commons.codec.language package.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is SolrCloud?” tab_id=”1562584824839-68207de8-f5fd”][vc_column_text]Apache Solr facilitates fault-tolerant, high-scalable searching capabilities that enable users to set up a highly-available cluster of Solr servers. These capabilities are well revered as SolrCloud.[/vc_column_text][/vc_tta_section][/vc_tta_accordion][/vc_column][vc_column css_animation=”fadeInRight” width=”1/2″][vc_tta_accordion color=”peacoc” active_section=”1″][vc_tta_section title=” What is copying field?” tab_id=”1562584846506-2035d047-b8f0″][vc_column_text]

It is used to describe how to populate fields with data copied from another field.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is Highlighting?” tab_id=”1562584846523-1f5edfc2-320b”][vc_column_text]

Highlighting refers to the fragmentation of documents matching the user’s query included in the query response. These fragments are then highlighted and placed in a special section, which is used by clients and users to present the snippets. Solr consists of a number of highlighting utilities having control over different fields. The highlighting utilities can be called by Request Handlers and reused with standard query parsers.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Name different types of highlighters?” tab_id=”1562584874832-446bb768-78f0″][vc_column_text]There are 3 highlighters in Solr:

  • Standard Highlighter : provides precise matches even for advanced queryparsers.
  • FastVector Highlighter : Though less advanced than Standard Highlighter, it works better for more languages and supports Unicode breakiterators.
  • Postings Highlighter : Much more precise, efficient and compact than the above vector one but inappropriate for a more number of query terms.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the use of stats.field?” tab_id=”1562584875320-b7f5f7f4-a63a”][vc_column_text]

It is used to generate statistics over the results of arbitrary numeric functions.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What command is used to see how to use the bin/Solr script?” tab_id=”1562584875927-23d9c93f-d71a”][vc_column_text]

Execute $ bin/Solr –helpto see how to use the bin/Solr script.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Which syntax is used to stop Solr?” tab_id=”1562584877189-b9a63058-f3ce”][vc_column_text]

$ bin/solr stop -p 8983 is used to stop Solr.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Which command is used to start Solr in foreground?” tab_id=”1562584877863-3bec980c-8725″][vc_column_text]

$ bin/solr start –f is used to start Solr in foreground.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What syntax is used to check whether Solr is currently running or not?” tab_id=”1562584878351-16f9bff6-c385″][vc_column_text]

$ bin/solr status is used to check Solr running status.

[/vc_column_text][/vc_tta_section][vc_tta_section title=” Give the syntax to start the server.” tab_id=”1562584878935-87c6fee6-36ff”][vc_column_text]

$ bin/solr start is used to start the server.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”How to shut down Apache Solr?” tab_id=”1562584879567-cd398c2d-5486″][vc_column_text]

Solr is shut down from the same terminal where it was launched. Click Ctrl+C to shut it down.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What data is specified by Schema?” tab_id=”1562584880071-2bb94038-9bb3″][vc_column_text]Schema declares –

  • how to index and search each field.
  • what kinds of fields are available.
  • what fields are required.
  • what field should be used as the unique/primary key

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Name the basic Field types in Solr?” tab_id=”1562584880692-d8eb6b63-9376″][vc_column_text]

  • date.
  • long
  • double
  • text
  • float

[/vc_column_text][/vc_tta_section][vc_tta_section title=”How to install Solr?” tab_id=”1562584881343-ed177e13-8acf”][vc_column_text]The three steps of Installation are:

  1. Server-related files, e.g. Tomcat or start.jar (Jetty).
  2. Solr webapp as a .war.
  3. Solr Home which comprises the data directory and configuration files

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What are the important configuration files of Solr?” tab_id=”1562584881959-9f7c7d7b-b636″][vc_column_text]Solr supports two important configuration files

  1. solrconfig.xml.
  2. schema.xml

[/vc_column_text][/vc_tta_section][vc_tta_section title=”What are the most common elements in solrconfig.xml?” tab_id=”1562584882704-0d470a19-ebff”][vc_column_text]

  1. Search components
  2. Cache parameters
  3. Data directory location
  4. Request handlers


WhatsApp us