Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View vsdev1's full-sized avatar

Volker Sommerfeld vsdev1

View GitHub Profile
@vsdev1
vsdev1 / LanguageDetectionComponent
Created January 13, 2014 09:26
Solr search component for language detection
/**
* Solr search component for language detection. It has the following configuration parameters (are configured in solrconfig.xml):
* <ul>
* <li>list of parameters language: supported languages</li>
* <li>languageDetectionProbabilityThreshold: the minimum detection probability for which the language detection is considered reliable (default is 0.09)</li>
* </ul>
*/
public class LanguageDetectionComponent extends SearchComponent {
public static final String LANGUAGE_REQUEST_PARAM_NAME = "language";
@vsdev1
vsdev1 / Common terms query parser plugin for Apache Solr
Last active January 2, 2016 20:29
Common terms query parser plugin for Apache Solr
/**
* Solr query parser login for the lucene common terms query. Must be used like q={!commonTermsQueryParser}WeightThe weight...
* where commonTermsQueryParser is configured in solrconfig.xml.
*
* The query field must be given as query parameter "qf". The maxTermFrequency can be configured in solrconfig.xml
* (default is 0.01). The query is executed against the field given in the request parameter qf while
* using the query analyzers of this field.
*
* see http://java.dzone.com/articles/create-custom-solr-queryparser
*/