![]() The FileBasedSpellChecker uses an external file as a spelling dictionary. 01, or 1%) or an absolute value (such as 4). These parameters ( maxQueryFrequency and thresholdTokenFrequency) can be a percentage (such as. After suggestions for every misspelled word are found they are filtered for enough frequency with thresholdTokenFrequency as boundary value. Words which are frequent than maxQueryFrequency bypass spellchecker unchanged. Only query words, which are absent in index or too rare ones (below maxQueryFrequency) are considered as misspelled and used for finding suggestions. There is no limit to term length by default.Īt first, spellchecker analyses incoming query words by looking up them in the index. maxQueryLength enables the spell checker to skip over very long query terms, which can avoid expensive operations or exceptions. minQueryLength defines how many characters must be in the query before suggestions are provided the default is 4. The maxInspections parameter defines the maximum number of possible matches to review before returning results the default is 5. Setting this to 1 means that the spelling suggestions will all start with the same letter, for example. minPrefix defines the minimum number of characters the terms should share. Since most spelling mistakes are only 1 letter off, setting this to 1 will reduce the number of possible suggestions (the default, however, is 2) the value can only be 1 or 2. The accuracy setting defines the threshold for a valid suggestion, while ma圎dits defines the number of changes to the term to allow. The value "internal" uses the default Levenshtein metric, which is the same metric used with the other spell checker implementations.īecause this spell checker is querying the main index, you may want to limit how often it queries the index to be sure to avoid any performance conflicts with user queries. ![]() The distanceMeasure defines the metric to use during the spell check query. Many of the parameters relate to how this spell checker should query the index for term suggestions. Note that you need to specify a field to use for the suggestions, so like the IndexBasedSpellChecker, you may want to copy data from fields like title, body, etc., to a field dedicated to providing spelling suggestions. When choosing a field to query for this spell checker, you want one which has relatively little analysis performed on it (particularly analysis such as stemming). default name solr.DirectSolrSpellChecker internal 0.5 2 1 5 4 40 0.01. Here is how this might be configured in solrconfig.xml ![]() This spell checker has the benefit of not having to be built regularly, meaning that the terms are always up-to-date with terms in the index. ![]() The DirectSolrSpellChecker uses terms from the Solr index without building a parallel index like the IndexBasedSpellChecker. It is optional, and can be omitted if you would rather set it to false. If the field has many word variations from processing synonyms and/or stemming, the dictionary will be created with those variations in addition to more valid spelling data.įinally, buildOnCommit defines whether to build the spell check index at every commit (that is, every time new documents are added to the index). When choosing a field for the spellcheck index, it’s best to avoid a heavily processed field to get more accurate results. The spellcheckIndexDir defines the location of the directory that holds the spellcheck index, while the field defines the source field (defined in the Schema) for spell check terms. Defining the classname is optional if not defined, it will default to IndexBasedSpellChecker. ![]() The classname is the specific implementation of the SpellCheckComponent, in this case solr.IndexBasedSpellChecker. The first element defines the searchComponent to use the solr.SpellCheckComponent. spellchecker content true .spell.LevenshteinDistance Here is a simple example of configuring solrconfig.xml with the IndexBasedSpellChecker: It requires defining a field as the basis for the index terms a common practice is to copy terms from some fields (such as title, body, etc.) to another field created for spell checking. The IndexBasedSpellChecker uses a Solr index as the basis for a parallel index used for spell checking. There are three approaches to spell checking in Solr, discussed below. The first step is to specify the source of terms in solrconfig.xml. Configuring the SpellCheckComponent Define Spell Check in solrconfig.xml The basis for these suggestions can be terms in a field in Solr, externally created text files, or fields in other Lucene indexes. The SpellCheck component is designed to provide inline query suggestions based on other, similar, terms. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |