Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.cloudsearchv2.model;
 

Options for a search suggester.

 
 public class DocumentSuggesterOptions implements SerializableCloneable {

    
The name of the index field you want to use for suggestions.

Constraints:
Length: 1 - 64
Pattern: [a-z][a-z0-9_]*

 
     private String sourceField;

    
The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.

Constraints:
Allowed Values: none, low, high

 
     private String fuzzyMatching;

    
An expression that computes a score for each suggestion to control how they are sorted. The scores are rounded to the nearest integer, with a floor of 0 and a ceiling of 2^31-1. A document's relevance score is not computed for suggestions, so sort expressions cannot reference the _score value. To sort suggestions using a numeric field or existing expression, simply specify the name of the field or expression. If no expression is configured for the suggester, the suggestions are sorted with the closest matches listed first.
 
     private String sortExpression;

    
The name of the index field you want to use for suggestions.

Constraints:
Length: 1 - 64
Pattern: [a-z][a-z0-9_]*

Returns:
The name of the index field you want to use for suggestions.
 
     public String getSourceField() {
         return ;
     }
    
    
The name of the index field you want to use for suggestions.

Constraints:
Length: 1 - 64
Pattern: [a-z][a-z0-9_]*

Parameters:
sourceField The name of the index field you want to use for suggestions.
 
     public void setSourceField(String sourceField) {
         this. = sourceField;
     }
    
    
The name of the index field you want to use for suggestions.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 64
Pattern: [a-z][a-z0-9_]*

Parameters:
sourceField The name of the index field you want to use for suggestions.
Returns:
A reference to this updated object so that method calls can be chained together.
 
    public DocumentSuggesterOptions withSourceField(String sourceField) {
        this. = sourceField;
        return this;
    }

    
The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.

Constraints:
Allowed Values: none, low, high

Returns:
The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.
See also:
SuggesterFuzzyMatching
    public String getFuzzyMatching() {
        return ;
    }
    
    
The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.

Constraints:
Allowed Values: none, low, high

Parameters:
fuzzyMatching The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.
See also:
SuggesterFuzzyMatching
    public void setFuzzyMatching(String fuzzyMatching) {
        this. = fuzzyMatching;
    }
    
    
The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: none, low, high

Parameters:
fuzzyMatching The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SuggesterFuzzyMatching
    public DocumentSuggesterOptions withFuzzyMatching(String fuzzyMatching) {
        this. = fuzzyMatching;
        return this;
    }

    
The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.

Constraints:
Allowed Values: none, low, high

Parameters:
fuzzyMatching The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.
See also:
SuggesterFuzzyMatching
    public void setFuzzyMatching(SuggesterFuzzyMatching fuzzyMatching) {
        this. = fuzzyMatching.toString();
    }
    
    
The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: none, low, high

Parameters:
fuzzyMatching The level of fuzziness allowed when suggesting matches for a string: none, low, or high. With none, the specified string is treated as an exact prefix. With low, suggestions must differ from the specified string by no more than one character. With high, suggestions can differ by up to two characters. The default is none.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SuggesterFuzzyMatching
        this. = fuzzyMatching.toString();
        return this;
    }

    
An expression that computes a score for each suggestion to control how they are sorted. The scores are rounded to the nearest integer, with a floor of 0 and a ceiling of 2^31-1. A document's relevance score is not computed for suggestions, so sort expressions cannot reference the _score value. To sort suggestions using a numeric field or existing expression, simply specify the name of the field or expression. If no expression is configured for the suggester, the suggestions are sorted with the closest matches listed first.

Returns:
An expression that computes a score for each suggestion to control how they are sorted. The scores are rounded to the nearest integer, with a floor of 0 and a ceiling of 2^31-1. A document's relevance score is not computed for suggestions, so sort expressions cannot reference the _score value. To sort suggestions using a numeric field or existing expression, simply specify the name of the field or expression. If no expression is configured for the suggester, the suggestions are sorted with the closest matches listed first.
    public String getSortExpression() {
        return ;
    }
    
    
An expression that computes a score for each suggestion to control how they are sorted. The scores are rounded to the nearest integer, with a floor of 0 and a ceiling of 2^31-1. A document's relevance score is not computed for suggestions, so sort expressions cannot reference the _score value. To sort suggestions using a numeric field or existing expression, simply specify the name of the field or expression. If no expression is configured for the suggester, the suggestions are sorted with the closest matches listed first.

Parameters:
sortExpression An expression that computes a score for each suggestion to control how they are sorted. The scores are rounded to the nearest integer, with a floor of 0 and a ceiling of 2^31-1. A document's relevance score is not computed for suggestions, so sort expressions cannot reference the _score value. To sort suggestions using a numeric field or existing expression, simply specify the name of the field or expression. If no expression is configured for the suggester, the suggestions are sorted with the closest matches listed first.
    public void setSortExpression(String sortExpression) {
        this. = sortExpression;
    }
    
    
An expression that computes a score for each suggestion to control how they are sorted. The scores are rounded to the nearest integer, with a floor of 0 and a ceiling of 2^31-1. A document's relevance score is not computed for suggestions, so sort expressions cannot reference the _score value. To sort suggestions using a numeric field or existing expression, simply specify the name of the field or expression. If no expression is configured for the suggester, the suggestions are sorted with the closest matches listed first.

Returns a reference to this object so that method calls can be chained together.

Parameters:
sortExpression An expression that computes a score for each suggestion to control how they are sorted. The scores are rounded to the nearest integer, with a floor of 0 and a ceiling of 2^31-1. A document's relevance score is not computed for suggestions, so sort expressions cannot reference the _score value. To sort suggestions using a numeric field or existing expression, simply specify the name of the field or expression. If no expression is configured for the suggester, the suggestions are sorted with the closest matches listed first.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DocumentSuggesterOptions withSortExpression(String sortExpression) {
        this. = sortExpression;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getSourceField() != nullsb.append("SourceField: " + getSourceField() + ",");
        if (getFuzzyMatching() != nullsb.append("FuzzyMatching: " + getFuzzyMatching() + ",");
        if (getSortExpression() != nullsb.append("SortExpression: " + getSortExpression() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSourceField() == null) ? 0 : getSourceField().hashCode()); 
        hashCode = prime * hashCode + ((getFuzzyMatching() == null) ? 0 : getFuzzyMatching().hashCode()); 
        hashCode = prime * hashCode + ((getSortExpression() == null) ? 0 : getSortExpression().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DocumentSuggesterOptions == falsereturn false;
        DocumentSuggesterOptions other = (DocumentSuggesterOptions)obj;
        
        if (other.getSourceField() == null ^ this.getSourceField() == nullreturn false;
        if (other.getSourceField() != null && other.getSourceField().equals(this.getSourceField()) == falsereturn false
        if (other.getFuzzyMatching() == null ^ this.getFuzzyMatching() == nullreturn false;
        if (other.getFuzzyMatching() != null && other.getFuzzyMatching().equals(this.getFuzzyMatching()) == falsereturn false
        if (other.getSortExpression() == null ^ this.getSortExpression() == nullreturn false;
        if (other.getSortExpression() != null && other.getSortExpression().equals(this.getSortExpression()) == falsereturn false
        return true;
    }
    
    @Override
    public DocumentSuggesterOptions clone() {
        try {
            return (DocumentSuggesterOptionssuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X