~slub.team/goobi-indexserver/3.x

« back to all changes in this revision

Viewing changes to solr/core/src/java/org/apache/solr/spelling/SpellingOptions.java

  • Committer: Sebastian Meyer
  • Date: 2012-08-03 09:12:40 UTC
  • Revision ID: sebastian.meyer@slub-dresden.de-20120803091240-x6861b0vabq1xror
Remove Lucene and Solr source code and add patches instead
Fix Bug #985487: Auto-suggestion for the search interface

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package org.apache.solr.spelling;
2
 
 
3
 
import org.apache.lucene.analysis.Token;
4
 
import org.apache.lucene.index.IndexReader;
5
 
import org.apache.solr.common.params.SolrParams;
6
 
 
7
 
import java.util.Collection;
8
 
/**
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
15
 
 *
16
 
 *     http://www.apache.org/licenses/LICENSE-2.0
17
 
 *
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.
23
 
 */
24
 
 
25
 
 
26
 
/**
27
 
 *
28
 
 *
29
 
 **/
30
 
public class SpellingOptions {
31
 
 
32
 
  /**
33
 
   * The tokens to spell check
34
 
   */
35
 
  public Collection<Token> tokens;
36
 
  /**
37
 
   * An optional {@link org.apache.lucene.index.IndexReader}
38
 
   */
39
 
  public IndexReader reader;
40
 
  /**
41
 
   * The number of suggestions to return, if there are any.  Defaults to 1.
42
 
   */
43
 
  public int count = 1;
44
 
  /**
45
 
   * Return only those results that are more popular, as defined by the implementation
46
 
   */
47
 
  public boolean onlyMorePopular;
48
 
  /**
49
 
   * Provide additional, per implementation, information about the results
50
 
   */
51
 
  public boolean extendedResults;
52
 
 
53
 
  /**
54
 
   * Optionally restrict the results to have a minimum accuracy level.  Per Implementation.
55
 
   * By default set to Float.MIN_VALUE.
56
 
   */
57
 
  public float accuracy = Float.MIN_VALUE;
58
 
 
59
 
  /**
60
 
   * Any other custom params can be passed through.  May be null and is null by default.
61
 
   */
62
 
  public SolrParams customParams;
63
 
 
64
 
  public SpellingOptions() {
65
 
  }
66
 
 
67
 
  //A couple of convenience ones
68
 
  public SpellingOptions(Collection<Token> tokens, int count) {
69
 
    this.tokens = tokens;
70
 
    this.count = count;
71
 
  }
72
 
 
73
 
  public SpellingOptions(Collection<Token> tokens, IndexReader reader) {
74
 
    this.tokens = tokens;
75
 
    this.reader = reader;
76
 
  }
77
 
 
78
 
  public SpellingOptions(Collection<Token> tokens, IndexReader reader, int count) {
79
 
    this.tokens = tokens;
80
 
    this.reader = reader;
81
 
    this.count = count;
82
 
  }
83
 
 
84
 
 
85
 
  public SpellingOptions(Collection<Token> tokens, IndexReader reader, int count, boolean onlyMorePopular, boolean extendedResults, float accuracy, SolrParams customParams) {
86
 
    this.tokens = tokens;
87
 
    this.reader = reader;
88
 
    this.count = count;
89
 
    this.onlyMorePopular = onlyMorePopular;
90
 
    this.extendedResults = extendedResults;
91
 
    this.accuracy = accuracy;
92
 
    this.customParams = customParams;
93
 
  }
94
 
}