private Query addRefinement(String navigationName, Refinement refinement) {
    Navigation navigation = navigations.get(navigationName);
    if (navigation == null) {
      navigation = new Navigation().setName(navigationName);
      navigation.setRange(refinement instanceof RefinementRange);
      navigations.put(navigationName, navigation);
    }
    navigation.getRefinements().add(refinement);
    return this;
  }
private Query addRefinement ( String navigationName , Refinement refinement ) { Navigation navigation = navigations . get ( navigationName ) ; if ( navigation == null ) { navigation = new Navigation ( ) . setName ( navigationName ) ; navigation . setRange ( refinement instanceof RefinementRange ) ; navigations . put ( navigationName , navigation ) ; } navigation . getRefinements ( ) . add ( refinement ) ; return this ; }
<code>
Add a refinement.  Please note that refinements are case-sensitive

JSON Reference:

Value and range refinements are both appended to an array on the refinements field.
Note the 'type' field, which marks the refinement as either a value or range refinement.

{ "refinements": [ {"type": "Range", "navigationName": "price", "low": "1.0", "high": "2.0"},
{"type": "Value", "navigationName": "brand", "value": "Nike" } ] }

Refinements can be negated by setting the exclude property. An excluded refinement will return
results that do not match the value or fall into the range specified in the refinement.

{ "refinements": [ {"type": "Range", "navigationName": "price", "low": "1.0", "high": "2.0", "exclude": true},
{"type": "Value", "navigationName": "brand", "value": "Nike", "exclude": true } ] }

</code>

@param navigationName
The name of the refinement
@param refinement
The refinement to add