1
|
/**
|
2
|
* Copyright (C) 2009 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.persistence.dao.hibernate.taxon;
|
11
|
|
12
|
|
13
|
import org.apache.lucene.store.Directory;
|
14
|
import org.springframework.beans.factory.annotation.Autowired;
|
15
|
import org.springframework.beans.factory.annotation.Qualifier;
|
16
|
import eu.etaxonomy.cdm.model.taxon.Synonym;
|
17
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
18
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
19
|
import eu.etaxonomy.cdm.persistence.dao.hibernate.AlternativeSpellingSuggestionParser;
|
20
|
|
21
|
//spelling support currently disabled in appcontext, see spelling.xml ... "
|
22
|
//@Component
|
23
|
public class TaxonAlternativeSpellingSuggestionParser extends AlternativeSpellingSuggestionParser<TaxonBase> {
|
24
|
|
25
|
public TaxonAlternativeSpellingSuggestionParser() {
|
26
|
super(TaxonBase.class);
|
27
|
Class<? extends TaxonBase> indexedClasses[] = new Class[2];
|
28
|
indexedClasses[0] = Taxon.class;
|
29
|
indexedClasses[1] = Synonym.class;
|
30
|
super.setIndexedClasses(indexedClasses);
|
31
|
super.setDefaultField("name.titleCache_tokenized");
|
32
|
}
|
33
|
|
34
|
@Override
|
35
|
@Autowired
|
36
|
public void setDirectory(@Qualifier("taxonSpellingDirectory")Directory directory) {
|
37
|
this.directory = directory;
|
38
|
}
|
39
|
}
|