1
package org.apache.solr.spelling;
3
import org.apache.lucene.analysis.Token;
4
import org.apache.lucene.index.IndexReader;
5
import org.apache.solr.common.params.SolrParams;
7
import java.util.Collection;
9
* Licensed to the Apache Software Foundation (ASF) under one or more
10
* contributor license agreements. See the NOTICE file distributed with
11
* this work for additional information regarding copyright ownership.
12
* The ASF licenses this file to You under the Apache License, Version 2.0
13
* (the "License"); you may not use this file except in compliance with
14
* the License. You may obtain a copy of the License at
16
* http://www.apache.org/licenses/LICENSE-2.0
18
* Unless required by applicable law or agreed to in writing, software
19
* distributed under the License is distributed on an "AS IS" BASIS,
20
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
* See the License for the specific language governing permissions and
22
* limitations under the License.
30
public class SpellingOptions {
33
* The tokens to spell check
35
public Collection<Token> tokens;
37
* An optional {@link org.apache.lucene.index.IndexReader}
39
public IndexReader reader;
41
* The number of suggestions to return, if there are any. Defaults to 1.
45
* Return only those results that are more popular, as defined by the implementation
47
public boolean onlyMorePopular;
49
* Provide additional, per implementation, information about the results
51
public boolean extendedResults;
54
* Optionally restrict the results to have a minimum accuracy level. Per Implementation.
55
* By default set to Float.MIN_VALUE.
57
public float accuracy = Float.MIN_VALUE;
60
* Any other custom params can be passed through. May be null and is null by default.
62
public SolrParams customParams;
64
public SpellingOptions() {
67
//A couple of convenience ones
68
public SpellingOptions(Collection<Token> tokens, int count) {
73
public SpellingOptions(Collection<Token> tokens, IndexReader reader) {
78
public SpellingOptions(Collection<Token> tokens, IndexReader reader, int count) {
85
public SpellingOptions(Collection<Token> tokens, IndexReader reader, int count, boolean onlyMorePopular, boolean extendedResults, float accuracy, SolrParams customParams) {
89
this.onlyMorePopular = onlyMorePopular;
90
this.extendedResults = extendedResults;
91
this.accuracy = accuracy;
92
this.customParams = customParams;