You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ad...@apache.org on 2011/09/08 17:26:05 UTC

svn commit: r1166744 - in /lucene/dev/branches/branch_3x/lucene: contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/ contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/ src/test/org/apache/lucene/queryParser/

Author: adrianocrestani
Date: Thu Sep  8 15:26:04 2011
New Revision: 1166744

URL: http://svn.apache.org/viewvc?rev=1166744&view=rev
Log:
committing LUCENE-2979_phillipe_ramalho_5_3x.patch from LUCENE-2979

Added:
    lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestAttributes.java
Modified:
    lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java
    lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/DefaultOperatorAttributeImpl.java
    lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldBoostMapFCListener.java
    lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldDateResolutionFCListener.java
    lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/StandardQueryConfigHandler.java

Modified: lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java?rev=1166744&r1=1166743&r2=1166744&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java Thu Sep  8 15:26:04 2011
@@ -29,9 +29,22 @@ import org.apache.lucene.queryParser.cor
 import org.apache.lucene.queryParser.core.QueryParserHelper;
 import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
 import org.apache.lucene.queryParser.standard.builders.StandardQueryTreeBuilder;
+import org.apache.lucene.queryParser.standard.config.AllowLeadingWildcardAttribute;
+import org.apache.lucene.queryParser.standard.config.AnalyzerAttribute;
+import org.apache.lucene.queryParser.standard.config.DateResolutionAttribute;
 import org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute;
+import org.apache.lucene.queryParser.standard.config.DefaultPhraseSlopAttribute;
+import org.apache.lucene.queryParser.standard.config.FieldBoostMapAttribute;
+import org.apache.lucene.queryParser.standard.config.FieldDateResolutionMapAttribute;
+import org.apache.lucene.queryParser.standard.config.FuzzyAttribute;
 import org.apache.lucene.queryParser.standard.config.FuzzyConfig;
+import org.apache.lucene.queryParser.standard.config.LocaleAttribute;
+import org.apache.lucene.queryParser.standard.config.LowercaseExpandedTermsAttribute;
+import org.apache.lucene.queryParser.standard.config.MultiFieldAttribute;
+import org.apache.lucene.queryParser.standard.config.MultiTermRewriteMethodAttribute;
 import org.apache.lucene.queryParser.standard.config.NumericConfig;
+import org.apache.lucene.queryParser.standard.config.PositionIncrementsAttribute;
+import org.apache.lucene.queryParser.standard.config.RangeCollatorAttribute;
 import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler;
 import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.Operator;
 import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.ConfigurationKeys;
@@ -113,7 +126,7 @@ import org.apache.lucene.search.Query;
  * @see StandardQueryTreeBuilder
  */
 public class StandardQueryParser extends QueryParserHelper {
-  
+
   /**
    * Constructs a {@link StandardQueryParser} object.
    */
@@ -122,7 +135,7 @@ public class StandardQueryParser extends
         new StandardQueryNodeProcessorPipeline(null),
         new StandardQueryTreeBuilder());
   }
-  
+
   /**
    * Constructs a {@link StandardQueryParser} object and sets an
    * {@link Analyzer} to it. The same as:
@@ -132,44 +145,41 @@ public class StandardQueryParser extends
    * qp.getQueryConfigHandler().setAnalyzer(analyzer);
    * </ul>
    * 
-   * @param analyzer
-   *          the analyzer to be used by this query parser helper
+   * @param analyzer the analyzer to be used by this query parser helper
    */
   public StandardQueryParser(Analyzer analyzer) {
     this();
-    
+
     this.setAnalyzer(analyzer);
   }
-  
+
   @Override
   public String toString() {
     return "<StandardQueryParser config=\"" + this.getQueryConfigHandler()
         + "\"/>";
   }
-  
+
   /**
    * Overrides {@link QueryParserHelper#parse(String, String)} so it casts the
    * return object to {@link Query}. For more reference about this method, check
    * {@link QueryParserHelper#parse(String, String)}.
    * 
-   * @param query
-   *          the query string
-   * @param defaultField
-   *          the default field used by the text parser
+   * @param query the query string
+   * @param defaultField the default field used by the text parser
    * 
    * @return the object built from the query
    * 
-   * @throws QueryNodeException
-   *           if something wrong happens along the three phases
+   * @throws QueryNodeException if something wrong happens along the three
+   *         phases
    */
   @Override
   public Query parse(String query, String defaultField)
       throws QueryNodeException {
-    
+
     return (Query) super.parse(query, defaultField);
-    
+
   }
-  
+
   /**
    * Gets implicit operator setting, which will be either {@link Operator#AND}
    * or {@link Operator#OR}.
@@ -177,7 +187,7 @@ public class StandardQueryParser extends
   public StandardQueryConfigHandler.Operator getDefaultOperator() {
     return getQueryConfigHandler().get(ConfigurationKeys.DEFAULT_OPERATOR);
   }
-  
+
   /**
    * Sets the collator used to determine index term inclusion in ranges for
    * RangeQuerys.
@@ -187,11 +197,16 @@ public class StandardQueryParser extends
    * referenced by lowerTerm and/or upperTerm to be examined. Depending on the
    * number of index Terms in this Field, the operation could be very slow.
    * 
-   * @param collator
-   *          the collator to use when constructing {@link RangeQueryNode}s
+   * @param collator the collator to use when constructing
+   *        {@link RangeQueryNode}s
    */
   public void setRangeCollator(Collator collator) {
-    getQueryConfigHandler().set(ConfigurationKeys.RANGE_COLLATOR, collator);
+    RangeCollatorAttribute attr = getQueryConfigHandler().getAttribute(
+        RangeCollatorAttribute.class);
+    attr.setDateResolution(collator);
+
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.RANGE_COLLATOR, collator);
   }
 
   /**
@@ -214,18 +229,10 @@ public class StandardQueryParser extends
    */
   @Deprecated
   public void setDefaultOperator(DefaultOperatorAttribute.Operator operator) {
-    org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.Operator newOperator;
-    
-    if (operator == DefaultOperatorAttribute.Operator.AND) {
-      newOperator = org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.Operator.AND;
-    } else {
-      newOperator = org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.Operator.OR;
-    }
-    
-    setDefaultOperator(newOperator);
-    
+    DefaultOperatorAttribute attr = getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
+    attr.setOperator(operator);
   }
-  
+
   /**
    * Sets the boolean operator of the QueryParser. In default mode (
    * {@link Operator#OR}) terms without any modifiers are considered optional:
@@ -234,10 +241,23 @@ public class StandardQueryParser extends
    * In {@link Operator#AND} mode terms are considered to be in conjunction: the
    * above mentioned query is parsed as <code>capital AND of AND Hungary</code>
    */
-  public void setDefaultOperator(org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.Operator operator) {
-    getQueryConfigHandler().set(ConfigurationKeys.DEFAULT_OPERATOR, operator);
+  public void setDefaultOperator(
+      org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.Operator operator) {
+    
+    DefaultOperatorAttribute.Operator attrOperator;
+    
+    if (operator == org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.Operator.AND) {
+      attrOperator = DefaultOperatorAttribute.Operator.AND;
+    } else {
+      attrOperator = DefaultOperatorAttribute.Operator.OR;
+    }
+    
+    setDefaultOperator(attrOperator);
+    
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.DEFAULT_OPERATOR, operator);
   }
-  
+
   /**
    * Set to <code>true</code> to allow leading wildcard characters.
    * <p>
@@ -248,24 +268,30 @@ public class StandardQueryParser extends
    * Default: false.
    */
   public void setLowercaseExpandedTerms(boolean lowercaseExpandedTerms) {
-    getQueryConfigHandler().set(ConfigurationKeys.LOWERCASE_EXPANDED_TERMS, lowercaseExpandedTerms);
+    LowercaseExpandedTermsAttribute attr = getQueryConfigHandler()
+        .getAttribute(LowercaseExpandedTermsAttribute.class);
+    attr.setLowercaseExpandedTerms(lowercaseExpandedTerms);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.LOWERCASE_EXPANDED_TERMS,
+    // lowercaseExpandedTerms);
   }
-  
+
   /**
    * @see #setLowercaseExpandedTerms(boolean)
    */
   public boolean getLowercaseExpandedTerms() {
-    Boolean lowercaseExpandedTerms = getQueryConfigHandler().get(ConfigurationKeys.LOWERCASE_EXPANDED_TERMS);
-    
+    Boolean lowercaseExpandedTerms = getQueryConfigHandler().get(
+        ConfigurationKeys.LOWERCASE_EXPANDED_TERMS);
+
     if (lowercaseExpandedTerms == null) {
       return true;
-      
+
     } else {
       return lowercaseExpandedTerms;
     }
-    
+
   }
-  
+
   /**
    * Set to <code>true</code> to allow leading wildcard characters.
    * <p>
@@ -276,9 +302,14 @@ public class StandardQueryParser extends
    * Default: false.
    */
   public void setAllowLeadingWildcard(boolean allowLeadingWildcard) {
-    getQueryConfigHandler().set(ConfigurationKeys.ALLOW_LEADING_WILDCARD, allowLeadingWildcard);
+    AllowLeadingWildcardAttribute attr = getQueryConfigHandler().getAttribute(
+        AllowLeadingWildcardAttribute.class);
+    attr.setAllowLeadingWildcard(allowLeadingWildcard);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.ALLOW_LEADING_WILDCARD,
+    // allowLeadingWildcard);
   }
-  
+
   /**
    * Set to <code>true</code> to enable position increments in result query.
    * <p>
@@ -289,24 +320,30 @@ public class StandardQueryParser extends
    * Default: false.
    */
   public void setEnablePositionIncrements(boolean enabled) {
-    getQueryConfigHandler().set(ConfigurationKeys.ENABLE_POSITION_INCREMENTS, enabled);
+    PositionIncrementsAttribute attr = getQueryConfigHandler().getAttribute(
+        PositionIncrementsAttribute.class);
+    attr.setPositionIncrementsEnabled(enabled);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.ENABLE_POSITION_INCREMENTS,
+    // enabled);
   }
-  
+
   /**
    * @see #setEnablePositionIncrements(boolean)
    */
   public boolean getEnablePositionIncrements() {
-    Boolean enablePositionsIncrements = getQueryConfigHandler().get(ConfigurationKeys.ENABLE_POSITION_INCREMENTS);
-    
+    Boolean enablePositionsIncrements = getQueryConfigHandler().get(
+        ConfigurationKeys.ENABLE_POSITION_INCREMENTS);
+
     if (enablePositionsIncrements == null) {
-       return false;
-       
+      return false;
+
     } else {
       return enablePositionsIncrements;
     }
-    
+
   }
-  
+
   /**
    * By default, it uses
    * {@link MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} when creating a
@@ -318,16 +355,22 @@ public class StandardQueryParser extends
    * not relevant then use this change the rewrite method.
    */
   public void setMultiTermRewriteMethod(MultiTermQuery.RewriteMethod method) {
-    getQueryConfigHandler().set(ConfigurationKeys.MULTI_TERM_REWRITE_METHOD, method);
+    MultiTermRewriteMethodAttribute attr = getQueryConfigHandler()
+        .getAttribute(MultiTermRewriteMethodAttribute.class);
+    attr.setMultiTermRewriteMethod(method);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.MULTI_TERM_REWRITE_METHOD,
+    // method);
   }
-  
+
   /**
    * @see #setMultiTermRewriteMethod(org.apache.lucene.search.MultiTermQuery.RewriteMethod)
    */
   public MultiTermQuery.RewriteMethod getMultiTermRewriteMethod() {
-    return getQueryConfigHandler().get(ConfigurationKeys.MULTI_TERM_REWRITE_METHOD);
+    return getQueryConfigHandler().get(
+        ConfigurationKeys.MULTI_TERM_REWRITE_METHOD);
   }
-  
+
   /**
    * Set the fields a query should be expanded to when the field is
    * <code>null</code>
@@ -335,18 +378,22 @@ public class StandardQueryParser extends
    * @param fields the fields used to expand the query
    */
   public void setMultiFields(CharSequence[] fields) {
-    
+
     if (fields == null) {
       fields = new CharSequence[0];
     }
 
-    getQueryConfigHandler().set(ConfigurationKeys.MULTI_FIELDS, fields);
-    
+    MultiFieldAttribute attr = getQueryConfigHandler().addAttribute(
+        MultiFieldAttribute.class);
+    attr.setFields(fields);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.MULTI_FIELDS, fields);
+
   }
-  
+
   /**
-   * Returns the fields used to expand the query when the field for a
-   * certain query is <code>null</code>
+   * Returns the fields used to expand the query when the field for a certain
+   * query is <code>null</code>
    * 
    * @param fields the fields used to expand the query
    */
@@ -357,44 +404,52 @@ public class StandardQueryParser extends
   /**
    * Set the prefix length for fuzzy queries. Default is 0.
    * 
-   * @param fuzzyPrefixLength
-   *          The fuzzyPrefixLength to set.
+   * @param fuzzyPrefixLength The fuzzyPrefixLength to set.
    */
   public void setFuzzyPrefixLength(int fuzzyPrefixLength) {
-    QueryConfigHandler config = getQueryConfigHandler();
-    FuzzyConfig fuzzyConfig = config.get(ConfigurationKeys.FUZZY_CONFIG);
-    
-    if (fuzzyConfig == null) {
-      fuzzyConfig = new FuzzyConfig();
-      config.set(ConfigurationKeys.FUZZY_CONFIG, fuzzyConfig);
-    }
+    FuzzyAttribute attr = getQueryConfigHandler().addAttribute(
+        FuzzyAttribute.class);
+    attr.setPrefixLength(fuzzyPrefixLength);
 
-    fuzzyConfig.setPrefixLength(fuzzyPrefixLength);
-    
+    // uncomment code below when deprecated query parser attributes are removed
+    /*
+     * QueryConfigHandler config = getQueryConfigHandler(); FuzzyConfig
+     * fuzzyConfig = config.get(ConfigurationKeys.FUZZY_CONFIG);
+     * 
+     * if (fuzzyConfig == null) { fuzzyConfig = new FuzzyConfig();
+     * config.set(ConfigurationKeys.FUZZY_CONFIG, fuzzyConfig); }
+     * 
+     * fuzzyConfig.setPrefixLength(fuzzyPrefixLength);
+     */
   }
-  
-  public void setNumericConfigMap(Map<String,NumericConfig> numericConfigMap) {
-    getQueryConfigHandler().set(ConfigurationKeys.NUMERIC_CONFIG_MAP, numericConfigMap);
+
+  public void setNumericConfigMap(Map<String, NumericConfig> numericConfigMap) {
+    getQueryConfigHandler().set(ConfigurationKeys.NUMERIC_CONFIG_MAP,
+        numericConfigMap);
   }
-  
-  public Map<String,NumericConfig> getNumericConfigMap() {
+
+  public Map<String, NumericConfig> getNumericConfigMap() {
     return getQueryConfigHandler().get(ConfigurationKeys.NUMERIC_CONFIG_MAP);
   }
-  
+
   /**
    * Set locale used by date range parsing.
    */
   public void setLocale(Locale locale) {
-    getQueryConfigHandler().set(ConfigurationKeys.LOCALE, locale);
+    LocaleAttribute attr = getQueryConfigHandler().addAttribute(
+        LocaleAttribute.class);
+    attr.setLocale(locale);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.LOCALE, locale);
   }
-  
+
   /**
    * Returns current locale, allowing access by subclasses.
    */
   public Locale getLocale() {
     return getQueryConfigHandler().get(ConfigurationKeys.LOCALE);
   }
-  
+
   /**
    * Sets the default slop for phrases. If zero, then exact phrase matches are
    * required. Default value is zero.
@@ -403,128 +458,154 @@ public class StandardQueryParser extends
    */
   @Deprecated
   public void setDefaultPhraseSlop(int defaultPhraseSlop) {
-    getQueryConfigHandler().set(ConfigurationKeys.PHRASE_SLOP, defaultPhraseSlop);
+    setPhraseSlop(defaultPhraseSlop);
   }
-  
+
   /**
    * Sets the default slop for phrases. If zero, then exact phrase matches are
    * required. Default value is zero.
    */
   public void setPhraseSlop(int defaultPhraseSlop) {
-    getQueryConfigHandler().set(ConfigurationKeys.PHRASE_SLOP, defaultPhraseSlop);
+    DefaultPhraseSlopAttribute attr = getQueryConfigHandler().addAttribute(
+        DefaultPhraseSlopAttribute.class);
+    attr.setDefaultPhraseSlop(defaultPhraseSlop);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.PHRASE_SLOP,
+    // defaultPhraseSlop);
   }
 
   public void setAnalyzer(Analyzer analyzer) {
-    getQueryConfigHandler().set(ConfigurationKeys.ANALYZER, analyzer);
+    AnalyzerAttribute attr = getQueryConfigHandler().getAttribute(
+        AnalyzerAttribute.class);
+    attr.setAnalyzer(analyzer);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.ANALYZER, analyzer);
   }
-  
+
   public Analyzer getAnalyzer() {
-    return getQueryConfigHandler().get(ConfigurationKeys.ANALYZER);       
+    return getQueryConfigHandler().get(ConfigurationKeys.ANALYZER);
   }
-  
+
   /**
    * @see #setAllowLeadingWildcard(boolean)
    */
   public boolean getAllowLeadingWildcard() {
-    Boolean allowLeadingWildcard = getQueryConfigHandler().get(ConfigurationKeys.ALLOW_LEADING_WILDCARD);
-    
+    Boolean allowLeadingWildcard = getQueryConfigHandler().get(
+        ConfigurationKeys.ALLOW_LEADING_WILDCARD);
+
     if (allowLeadingWildcard == null) {
       return false;
-      
+
     } else {
       return allowLeadingWildcard;
     }
   }
-  
+
   /**
    * Get the minimal similarity for fuzzy queries.
    */
   public float getFuzzyMinSim() {
-    FuzzyConfig fuzzyConfig = getQueryConfigHandler().get(ConfigurationKeys.FUZZY_CONFIG);
-    
+    FuzzyConfig fuzzyConfig = getQueryConfigHandler().get(
+        ConfigurationKeys.FUZZY_CONFIG);
+
     if (fuzzyConfig == null) {
       return FuzzyQuery.defaultMinSimilarity;
     } else {
       return fuzzyConfig.getMinSimilarity();
     }
   }
-  
+
   /**
    * Get the prefix length for fuzzy queries.
    * 
    * @return Returns the fuzzyPrefixLength.
    */
   public int getFuzzyPrefixLength() {
-    FuzzyConfig fuzzyConfig = getQueryConfigHandler().get(ConfigurationKeys.FUZZY_CONFIG);
-    
+    FuzzyConfig fuzzyConfig = getQueryConfigHandler().get(
+        ConfigurationKeys.FUZZY_CONFIG);
+
     if (fuzzyConfig == null) {
       return FuzzyQuery.defaultPrefixLength;
     } else {
       return fuzzyConfig.getPrefixLength();
     }
   }
-  
+
   /**
    * Gets the default slop for phrases.
    */
   public int getPhraseSlop() {
-    Integer phraseSlop = getQueryConfigHandler().get(ConfigurationKeys.PHRASE_SLOP);
-    
+    Integer phraseSlop = getQueryConfigHandler().get(
+        ConfigurationKeys.PHRASE_SLOP);
+
     if (phraseSlop == null) {
       return 0;
-      
+
     } else {
       return phraseSlop;
     }
   }
-  
+
   /**
    * Set the minimum similarity for fuzzy queries. Default is defined on
    * {@link FuzzyQuery#defaultMinSimilarity}.
    */
   public void setFuzzyMinSim(float fuzzyMinSim) {
-    QueryConfigHandler config = getQueryConfigHandler();
-    FuzzyConfig fuzzyConfig = config.get(ConfigurationKeys.FUZZY_CONFIG);
-    
-    if (fuzzyConfig == null) {
-      fuzzyConfig = new FuzzyConfig();
-      config.set(ConfigurationKeys.FUZZY_CONFIG, fuzzyConfig);
-    }
-
-    fuzzyConfig.setMinSimilarity(fuzzyMinSim);
+    FuzzyAttribute attr = getQueryConfigHandler().addAttribute(
+        FuzzyAttribute.class);
+    attr.setFuzzyMinSimilarity(fuzzyMinSim);
+    // uncomment code below when deprecated query parser attributes are removed
+    /*
+     * QueryConfigHandler config = getQueryConfigHandler(); FuzzyConfig
+     * fuzzyConfig = config.get(ConfigurationKeys.FUZZY_CONFIG);
+     * 
+     * if (fuzzyConfig == null) { fuzzyConfig = new FuzzyConfig();
+     * config.set(ConfigurationKeys.FUZZY_CONFIG, fuzzyConfig); }
+     * 
+     * fuzzyConfig.setMinSimilarity(fuzzyMinSim);
+     */
   }
-  
+
   /**
    * Sets the boost used for each field.
    * 
-   * @param boosts a collection that maps a field to its boost 
+   * @param boosts a collection that maps a field to its boost
    */
   public void setFieldsBoost(Map<String, Float> boosts) {
-    getQueryConfigHandler().set(ConfigurationKeys.FIELD_BOOST_MAP, boosts);
+    FieldBoostMapAttribute attr = getQueryConfigHandler().addAttribute(
+        FieldBoostMapAttribute.class);
+    attr.setFieldBoostMap(boosts);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.FIELD_BOOST_MAP, boosts);
   }
-  
+
   /**
    * Returns the field to boost map used to set boost for each field.
    * 
-   * @return the field to boost map 
+   * @return the field to boost map
    */
   public Map<String, Float> getFieldsBoost() {
     return getQueryConfigHandler().get(ConfigurationKeys.FIELD_BOOST_MAP);
   }
 
   /**
-   * Sets the default {@link Resolution} used for certain field when
-   * no {@link Resolution} is defined for this field.
+   * Sets the default {@link Resolution} used for certain field when no
+   * {@link Resolution} is defined for this field.
    * 
    * @param dateResolution the default {@link Resolution}
    */
   public void setDateResolution(DateTools.Resolution dateResolution) {
-    getQueryConfigHandler().set(ConfigurationKeys.DATE_RESOLUTION, dateResolution);
+    DateResolutionAttribute attr = getQueryConfigHandler().addAttribute(
+        DateResolutionAttribute.class);
+    attr.setDateResolution(dateResolution);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.DATE_RESOLUTION,
+    // dateResolution);
   }
-  
+
   /**
-   * Returns the default {@link Resolution} used for certain field when
-   * no {@link Resolution} is defined for this field.
+   * Returns the default {@link Resolution} used for certain field when no
+   * {@link Resolution} is defined for this field.
    * 
    * @return the default {@link Resolution}
    */
@@ -537,29 +618,37 @@ public class StandardQueryParser extends
    * 
    * @param dateRes a collection that maps a field to its {@link Resolution}
    * 
-   * @deprecated this method was renamed to {@link #setDateResolutionMap(Map)} 
+   * @deprecated this method was renamed to {@link #setDateResolutionMap(Map)}
    */
   @Deprecated
   public void setDateResolution(Map<CharSequence, DateTools.Resolution> dateRes) {
     setDateResolutionMap(dateRes);
   }
-  
+
   /**
-   * Returns the field to {@link Resolution} map used to normalize each date field.
+   * Returns the field to {@link Resolution} map used to normalize each date
+   * field.
    * 
    * @return the field to {@link Resolution} map
    */
   public Map<CharSequence, DateTools.Resolution> getDateResolutionMap() {
-    return getQueryConfigHandler().get(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP);
+    return getQueryConfigHandler().get(
+        ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP);
   }
-  
+
   /**
    * Sets the {@link Resolution} used for each field
    * 
    * @param dateRes a collection that maps a field to its {@link Resolution}
    */
-  public void setDateResolutionMap(Map<CharSequence, DateTools.Resolution> dateRes) {
-    getQueryConfigHandler().set(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP, dateRes);
+  public void setDateResolutionMap(
+      Map<CharSequence, DateTools.Resolution> dateRes) {
+    FieldDateResolutionMapAttribute attr = getQueryConfigHandler()
+        .addAttribute(FieldDateResolutionMapAttribute.class);
+    attr.setFieldDateResolutionMap(dateRes);
+    // uncomment code below when deprecated query parser attributes are removed
+    // getQueryConfigHandler().set(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP,
+    // dateRes);
   }
-  
+
 }

Modified: lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/DefaultOperatorAttributeImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/DefaultOperatorAttributeImpl.java?rev=1166744&r1=1166743&r2=1166744&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/DefaultOperatorAttributeImpl.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/DefaultOperatorAttributeImpl.java Thu Sep  8 15:26:04 2011
@@ -72,9 +72,9 @@ public class DefaultOperatorAttributeImp
     Operator oldOperator;
     
     if (newOperator == org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.Operator.AND) {
-      oldOperator = Operator.OR;
-    } else {
       oldOperator = Operator.AND;
+    } else {
+      oldOperator = Operator.OR;
     }
     
     return oldOperator;

Modified: lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldBoostMapFCListener.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldBoostMapFCListener.java?rev=1166744&r1=1166743&r2=1166744&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldBoostMapFCListener.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldBoostMapFCListener.java Thu Sep  8 15:26:04 2011
@@ -52,7 +52,12 @@ public class FieldBoostMapFCListener imp
       Float boost = fieldBoostMap.get(fieldConfig.getField());
 
       if (boost != null) {
-        fieldConfig.set(ConfigurationKeys.BOOST, boost);
+        
+        fieldConfig.addAttribute(BoostAttribute.class).setBoost(boost);
+        
+        // uncomment code below when deprecated query parser attributes are removed
+        // fieldConfig.set(ConfigurationKeys.BOOST, boost);
+        
       }
 
     }

Modified: lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldDateResolutionFCListener.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldDateResolutionFCListener.java?rev=1166744&r1=1166743&r2=1166744&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldDateResolutionFCListener.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldDateResolutionFCListener.java Thu Sep  8 15:26:04 2011
@@ -57,7 +57,10 @@ public class FieldDateResolutionFCListen
       dateRes = this.config.get(ConfigurationKeys.DATE_RESOLUTION);
     }
 
-    fieldConfig.set(ConfigurationKeys.DATE_RESOLUTION, dateRes);
+    fieldConfig.addAttribute(DateResolutionAttribute.class).setDateResolution(dateRes);
+    
+    // uncomment code below when deprecated query parser attributes are removed
+    // fieldConfig.set(ConfigurationKeys.DATE_RESOLUTION, dateRes);
 
   }
 

Modified: lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/StandardQueryConfigHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/StandardQueryConfigHandler.java?rev=1166744&r1=1166743&r2=1166744&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/StandardQueryConfigHandler.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/StandardQueryConfigHandler.java Thu Sep  8 15:26:04 2011
@@ -220,22 +220,26 @@ public class StandardQueryConfigHandler 
     addFieldConfigListener(new FieldDateResolutionFCListener(this));
     addFieldConfigListener(new NumericFieldConfigListener(this));
 
-    // Default Values
-    set(ConfigurationKeys.ALLOW_LEADING_WILDCARD, false); // default in 2.9
-    set(ConfigurationKeys.ANALYZER, null); // default value 2.4
-    set(ConfigurationKeys.DEFAULT_OPERATOR, Operator.OR);
-    set(ConfigurationKeys.PHRASE_SLOP, 0); // default value 2.4
-    set(ConfigurationKeys.LOWERCASE_EXPANDED_TERMS, true); // default value 2.4
-    set(ConfigurationKeys.ENABLE_POSITION_INCREMENTS, false); // default value
-                                                              // 2.4
-    set(ConfigurationKeys.FIELD_BOOST_MAP, new LinkedHashMap<String, Float>());
-    set(ConfigurationKeys.FUZZY_CONFIG, new FuzzyConfig());
-    set(ConfigurationKeys.LOCALE, Locale.getDefault());
-    set(ConfigurationKeys.MULTI_TERM_REWRITE_METHOD,
-        MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT);
-    set(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP,
-        new HashMap<CharSequence, DateTools.Resolution>());
-    
+    // uncomment code below when deprecated query parser attributes are removed
+    // // Default Values
+    // set(ConfigurationKeys.ALLOW_LEADING_WILDCARD, false); // default in 2.9
+    // set(ConfigurationKeys.ANALYZER, null); // default value 2.4
+    // set(ConfigurationKeys.DEFAULT_OPERATOR, Operator.OR);
+    // set(ConfigurationKeys.PHRASE_SLOP, 0); // default value 2.4
+    // set(ConfigurationKeys.LOWERCASE_EXPANDED_TERMS, true); // default value
+    // 2.4
+    // set(ConfigurationKeys.ENABLE_POSITION_INCREMENTS, false); // default
+    // value
+    // // 2.4
+    // set(ConfigurationKeys.FIELD_BOOST_MAP, new LinkedHashMap<String,
+    // Float>());
+    // set(ConfigurationKeys.FUZZY_CONFIG, new FuzzyConfig());
+    // set(ConfigurationKeys.LOCALE, Locale.getDefault());
+    // set(ConfigurationKeys.MULTI_TERM_REWRITE_METHOD,
+    // MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT);
+    // set(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP,
+    // new HashMap<CharSequence, DateTools.Resolution>());
+
     // still add old attributes
     addAttribute(RangeCollatorAttribute.class);
     addAttribute(DefaultOperatorAttribute.class);
@@ -248,6 +252,7 @@ public class StandardQueryConfigHandler 
     addAttribute(LocaleAttribute.class);
     addAttribute(DefaultPhraseSlopAttribute.class);
     addAttribute(MultiTermRewriteMethodAttribute.class);   
+    addAttribute(FieldBoostMapAttribute.class);   
 
   }
 

Added: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestAttributes.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestAttributes.java?rev=1166744&view=auto
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestAttributes.java (added)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestAttributes.java Thu Sep  8 15:26:04 2011
@@ -0,0 +1,250 @@
+package org.apache.lucene.queryParser;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License 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.
+ */
+
+import java.text.CollationKey;
+import java.text.Collator;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Locale;
+
+import junit.framework.Assert;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.apache.lucene.document.DateTools;
+import org.apache.lucene.queryParser.standard.config.AllowLeadingWildcardAttribute;
+import org.apache.lucene.queryParser.standard.config.AnalyzerAttribute;
+import org.apache.lucene.queryParser.standard.config.BoostAttribute;
+import org.apache.lucene.queryParser.standard.config.DateResolutionAttribute;
+import org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute;
+import org.apache.lucene.queryParser.standard.config.DefaultPhraseSlopAttribute;
+import org.apache.lucene.queryParser.standard.config.FieldBoostMapAttribute;
+import org.apache.lucene.queryParser.standard.config.FieldDateResolutionMapAttribute;
+import org.apache.lucene.queryParser.standard.config.FuzzyAttribute;
+import org.apache.lucene.queryParser.standard.config.LocaleAttribute;
+import org.apache.lucene.queryParser.standard.config.LowercaseExpandedTermsAttribute;
+import org.apache.lucene.queryParser.standard.config.MultiFieldAttribute;
+import org.apache.lucene.queryParser.standard.config.MultiTermRewriteMethodAttribute;
+import org.apache.lucene.queryParser.standard.config.PositionIncrementsAttribute;
+import org.apache.lucene.queryParser.standard.config.RangeCollatorAttribute;
+import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler;
+import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.ConfigurationKeys;
+import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler.Operator;
+import org.apache.lucene.search.FuzzyQuery;
+import org.apache.lucene.search.MultiTermQuery;
+import org.apache.lucene.util.LuceneTestCase;
+import org.junit.Test;
+
+public class TestAttributes extends LuceneTestCase {
+
+  @Test
+  public void testAttributes() {
+    StandardQueryConfigHandler config = new StandardQueryConfigHandler();
+
+    AnalyzerAttribute analyzerAttr = config
+        .addAttribute(AnalyzerAttribute.class);
+
+    Assert.assertTrue(null == analyzerAttr.getAnalyzer());
+    Assert.assertTrue(null == config.get(ConfigurationKeys.ANALYZER));
+    Analyzer analyzer = new KeywordAnalyzer();
+    analyzerAttr.setAnalyzer(analyzer);
+    Assert.assertTrue(analyzer == analyzerAttr.getAnalyzer());
+    Assert.assertTrue(analyzer == config.get(ConfigurationKeys.ANALYZER));
+
+    DateResolutionAttribute dateResAttr = config
+        .addAttribute(DateResolutionAttribute.class);
+
+    Assert.assertTrue(null == dateResAttr.getDateResolution());
+    Assert.assertTrue(null == config.get(ConfigurationKeys.DATE_RESOLUTION));
+    DateTools.Resolution dateRes = DateTools.Resolution.HOUR;
+    dateResAttr.setDateResolution(dateRes);
+    Assert.assertTrue(dateRes == dateResAttr.getDateResolution());
+    Assert.assertTrue(dateRes == config.get(ConfigurationKeys.DATE_RESOLUTION));
+
+    DefaultPhraseSlopAttribute defaultPhraseSlopAttr = config
+        .addAttribute(DefaultPhraseSlopAttribute.class);
+
+    Assert.assertEquals(0, defaultPhraseSlopAttr.getDefaultPhraseSlop());
+    Assert
+        .assertEquals(0, config.get(ConfigurationKeys.PHRASE_SLOP).intValue());
+    int phraseSlop = 1;
+    defaultPhraseSlopAttr.setDefaultPhraseSlop(phraseSlop);
+    Assert.assertEquals(phraseSlop, defaultPhraseSlopAttr
+        .getDefaultPhraseSlop());
+    Assert.assertEquals(phraseSlop, config.get(ConfigurationKeys.PHRASE_SLOP)
+        .intValue());
+
+    FieldBoostMapAttribute fieldBoostMapAttr = config
+        .addAttribute(FieldBoostMapAttribute.class);
+
+    Assert.assertEquals(new LinkedHashMap<String, Float>(), fieldBoostMapAttr
+        .getFieldBoostMap());
+    Assert.assertEquals(new LinkedHashMap<String, Float>(), config
+        .get(ConfigurationKeys.FIELD_BOOST_MAP));
+    LinkedHashMap<String, Float> fieldBoostMap = new LinkedHashMap<String, Float>();
+    fieldBoostMap.put("test", 0.3f);
+    fieldBoostMapAttr.setFieldBoostMap(fieldBoostMap);
+    Assert.assertEquals(fieldBoostMap, fieldBoostMapAttr.getFieldBoostMap());
+    Assert.assertEquals(fieldBoostMap, config
+        .get(ConfigurationKeys.FIELD_BOOST_MAP));
+
+    FieldDateResolutionMapAttribute fieldDateResolutionMapAttr = config
+        .addAttribute(FieldDateResolutionMapAttribute.class);
+
+    Assert.assertEquals(new HashMap<CharSequence, DateTools.Resolution>(),
+        fieldDateResolutionMapAttr.getFieldDateResolutionMap());
+    Assert.assertEquals(new HashMap<CharSequence, DateTools.Resolution>(),
+        config.get(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP));
+    HashMap<CharSequence, DateTools.Resolution> fieldDateResMap = new HashMap<CharSequence, DateTools.Resolution>();
+    fieldDateResMap.put("test", DateTools.Resolution.HOUR);
+    fieldDateResolutionMapAttr.setFieldDateResolutionMap(fieldDateResMap);
+    Assert.assertEquals(fieldDateResMap, fieldDateResolutionMapAttr.getFieldDateResolutionMap());
+    Assert.assertEquals(fieldDateResMap, config
+        .get(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP));
+
+    LocaleAttribute localeAttr = config.addAttribute(LocaleAttribute.class);
+
+    Assert.assertEquals(Locale.getDefault(), localeAttr.getLocale());
+    Assert.assertEquals(Locale.getDefault(), config
+        .get(ConfigurationKeys.LOCALE));
+    Locale locale = Locale.CHINA;
+    localeAttr.setLocale(locale);
+    Assert.assertEquals(locale, localeAttr.getLocale());
+    Assert.assertEquals(locale, config.get(ConfigurationKeys.LOCALE));
+
+    LowercaseExpandedTermsAttribute lowercaseExpandedTermsAttr = config
+        .addAttribute(LowercaseExpandedTermsAttribute.class);
+
+    Assert.assertEquals(true, lowercaseExpandedTermsAttr
+        .isLowercaseExpandedTerms());
+    Assert.assertEquals(true, config.get(
+        ConfigurationKeys.LOWERCASE_EXPANDED_TERMS).booleanValue());
+    boolean lowercaseEnabled = false;
+    lowercaseExpandedTermsAttr.setLowercaseExpandedTerms(lowercaseEnabled);
+    Assert.assertEquals(lowercaseEnabled, lowercaseExpandedTermsAttr
+        .isLowercaseExpandedTerms());
+    Assert.assertEquals(lowercaseEnabled, config.get(
+        ConfigurationKeys.LOWERCASE_EXPANDED_TERMS).booleanValue());
+
+    MultiTermRewriteMethodAttribute multiTermRewriteMethodAttr = config
+        .addAttribute(MultiTermRewriteMethodAttribute.class);
+
+    Assert
+        .assertTrue(MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT == multiTermRewriteMethodAttr
+            .getMultiTermRewriteMethod());
+    Assert
+        .assertTrue(MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT == config
+            .get(ConfigurationKeys.MULTI_TERM_REWRITE_METHOD));
+    MultiTermQuery.RewriteMethod rewriteMethod = MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE;
+    multiTermRewriteMethodAttr.setMultiTermRewriteMethod(rewriteMethod);
+    Assert.assertTrue(rewriteMethod == multiTermRewriteMethodAttr
+        .getMultiTermRewriteMethod());
+    Assert.assertTrue(rewriteMethod == config
+        .get(ConfigurationKeys.MULTI_TERM_REWRITE_METHOD));
+
+    PositionIncrementsAttribute positionIncrementsAttr = config
+        .addAttribute(PositionIncrementsAttribute.class);
+
+    Assert.assertEquals(false, positionIncrementsAttr
+        .isPositionIncrementsEnabled());
+    Assert.assertEquals(false, config.get(
+        ConfigurationKeys.ENABLE_POSITION_INCREMENTS).booleanValue());
+    boolean posIncrEnabled = true;
+    positionIncrementsAttr.setPositionIncrementsEnabled(posIncrEnabled);
+    Assert.assertEquals(posIncrEnabled, positionIncrementsAttr
+        .isPositionIncrementsEnabled());
+    Assert.assertEquals(posIncrEnabled, config.get(
+        ConfigurationKeys.ENABLE_POSITION_INCREMENTS).booleanValue());
+
+    RangeCollatorAttribute rangeCollatorAttr = config
+        .addAttribute(RangeCollatorAttribute.class);
+
+    Assert.assertTrue(null == rangeCollatorAttr.getRangeCollator());
+    Assert.assertTrue(null == config.get(ConfigurationKeys.RANGE_COLLATOR));
+    Collator collator = new Collator() {
+
+      @Override
+      public int compare(String arg0, String arg1) {
+        return 0;
+      }
+
+      @Override
+      public CollationKey getCollationKey(String arg0) {
+        return null;
+      }
+
+      @Override
+      public int hashCode() {
+        return 0;
+      }
+
+    };
+    rangeCollatorAttr.setDateResolution(collator);
+    Assert.assertTrue(collator == rangeCollatorAttr.getRangeCollator());
+    Assert.assertTrue(collator == config.get(ConfigurationKeys.RANGE_COLLATOR));
+
+    BoostAttribute boostAttr = config.addAttribute(BoostAttribute.class);
+
+    Assert.assertEquals(1.0f, boostAttr.getBoost());
+    Assert.assertEquals(1.0f, config.get(ConfigurationKeys.BOOST).floatValue());
+    float boost = 2.0f;
+    boostAttr.setBoost(boost);
+    Assert.assertEquals(boost, boostAttr.getBoost());
+    Assert
+        .assertEquals(boost, config.get(ConfigurationKeys.BOOST).floatValue());
+
+    FuzzyAttribute fuzzyAttributeAttr = config
+        .addAttribute(FuzzyAttribute.class);
+
+    Assert.assertEquals(FuzzyQuery.defaultMinSimilarity, fuzzyAttributeAttr
+        .getFuzzyMinSimilarity());
+    Assert.assertEquals(FuzzyQuery.defaultPrefixLength, fuzzyAttributeAttr
+        .getPrefixLength());
+    Assert.assertEquals(FuzzyQuery.defaultMinSimilarity, config.get(
+        ConfigurationKeys.FUZZY_CONFIG).getMinSimilarity());
+    Assert.assertEquals(FuzzyQuery.defaultPrefixLength, config.get(
+        ConfigurationKeys.FUZZY_CONFIG).getPrefixLength());
+    int prefixLength = 232;
+    float minSim = 23.923f;
+    fuzzyAttributeAttr.setFuzzyMinSimilarity(minSim);
+    fuzzyAttributeAttr.setPrefixLength(prefixLength);
+    Assert.assertEquals(minSim, fuzzyAttributeAttr.getFuzzyMinSimilarity());
+    Assert.assertEquals(prefixLength, fuzzyAttributeAttr.getPrefixLength());
+    Assert.assertEquals(minSim, config.get(ConfigurationKeys.FUZZY_CONFIG)
+        .getMinSimilarity());
+    Assert.assertEquals(prefixLength, config
+        .get(ConfigurationKeys.FUZZY_CONFIG).getPrefixLength());
+
+    DefaultOperatorAttribute defaultOpAttr = config
+        .addAttribute(DefaultOperatorAttribute.class);
+
+    Assert.assertEquals(DefaultOperatorAttribute.Operator.OR, defaultOpAttr
+        .getOperator());
+    Assert.assertEquals(Operator.OR, config
+        .get(ConfigurationKeys.DEFAULT_OPERATOR));
+    DefaultOperatorAttribute.Operator oldOperator = DefaultOperatorAttribute.Operator.AND;
+    Operator newOperator = Operator.AND;
+    defaultOpAttr.setOperator(oldOperator);
+    Assert.assertEquals(oldOperator, defaultOpAttr.getOperator());
+    Assert.assertEquals(newOperator, config
+        .get(ConfigurationKeys.DEFAULT_OPERATOR));
+
+  }
+
+}
\ No newline at end of file