After defining the field type in schema.xml and named the analysis steps that you want to apply to it, you must test it out to confirm that it performed the way you require, to achieve the same you will be provided with the SOLR admin interface. You will have an option to invoke the analyzer for any text field, insert the sample input, and show the resulting token stream.
E.g. If you wish to add the below field type to intellipaat.xml
<fieldType name="mytermsField" class="solr.TermsField"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.HyphenatedWordsFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType>
The purpose is to reconstruct the hyphenated words. To test this out refer the below fig.
Simple Post Tool: There exists a command line tool for POSTing raw XML to a SOLR port. The data in the form of XML will be read from the specified files as command line arguments, as unrefined command line argument strings or through STDIN.
The tool is named as post.jar and can be accessed from ‘exampledocs’ directory: $SOLR/example/exampledocs/post.jar includes a cross-platform Java tool for POST-ing XML documents.
Open a window to turn it and enter as below.
java -jar post.jar <enter message with the list of files>
Uploading Data with Index Handlers: These are the request handlers created to add, remove and update the documents in the index. Also to get the for importing the rich documents using Tika or from structured data sources using the Data Import Handler, SOLR supports indexing structured documents in JSON, CSV as well in XML.
The attributes that accept by Commit and Optimize operations.
|waitSearcher||Default is true. Blocks until a new searcher is opened and registered as the main query searcher, making the changes visible.|
|expungeDeletes||Default is false. Merges segments that have more than 10% deleted docs, expunging them in the process.|
|maxSegments||Default is 1. Merges the segments down to no more than this number of segments.|
<commit waitSearcher="true"/> <commit waitSearcher="true" expungeDeletes="false"/> <optimize waitSearcher="true"/>
This blog will help you get a better understanding of Solr + Hadoop = Big Data LovePrevious Next
Download Interview Questions asked by top MNCs in 2019?