001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 Echo Three, LLC 003// 004// Licensed under the Apache License, Version 2.0 (the "License"); 005// you may not use this file except in compliance with the License. 006// You may obtain a copy of the License at 007// 008// http://www.apache.org/licenses/LICENSE-2.0 009// 010// Unless required by applicable law or agreed to in writing, software 011// distributed under the License is distributed on an "AS IS" BASIS, 012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013// See the License for the specific language governing permissions and 014// limitations under the License. 015// -------------------------------------------------------------------------------- 016 017package com.echothree.model.control.item.server.search; 018 019import com.echothree.model.control.core.common.ComponentVendors; 020import com.echothree.model.control.core.common.EntityTypes; 021import com.echothree.model.control.index.common.IndexTypes; 022import com.echothree.model.control.index.server.analysis.ItemAnalyzer; 023import com.echothree.model.control.item.server.logic.ItemDescriptionLogic; 024import com.echothree.model.control.search.server.search.BaseSpellCheckEvaluator; 025import com.echothree.model.data.party.server.entity.Language; 026import com.echothree.model.data.search.server.entity.SearchDefaultOperator; 027import com.echothree.model.data.user.server.entity.UserVisit; 028import com.echothree.util.server.message.ExecutionErrorAccumulator; 029import org.apache.lucene.analysis.Analyzer; 030 031public class ItemSpellCheckEvaluator 032 extends BaseSpellCheckEvaluator { 033 034 /** Creates a new instance of ItemSearchEvaluator */ 035 public ItemSpellCheckEvaluator(UserVisit userVisit, Language language, SearchDefaultOperator searchDefaultOperator) { 036 super(userVisit, searchDefaultOperator, ComponentVendors.ECHO_THREE.name(), EntityTypes.Item.name(), 037 IndexTypes.ITEM.name(), language, null); 038 039 setField(ItemDescriptionLogic.getInstance().getIndexDefaultItemDescriptionTypeName()); 040 } 041 042 @Override 043 public Analyzer getAnalyzer(final ExecutionErrorAccumulator eea, final Language language) { 044 return new ItemAnalyzer(eea, language, entityType); 045 } 046 047}