Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.englishtown.vertx.solr.querybuilder;

 
 public class Group {
     private StringBuilder groupBuilder;
     private int boost;
 
     Group() {
         = new StringBuilder("(");
    }
    public static Group group(Term term) {
        return new Group().term(term);
    }
    public Group term(Term term) {
        .append(term.toString());
        return this;
    }
    public Group and(Term term) {
        .append(" AND ");
        return term(term);
    }
    public Group or(Term term) {
        .append(" OR ");
        return term(term);
    }

    
Allows for the entire group to be boosted.

Parameters:
boost
Returns:
    public Group boost(int boost) {
        this. = boost;
        return this;
    }
    @Override
    public String toString() {
        .append(")");
        if ( > 0) {
            .append("^");
            .append(Integer.toString());
        }
        return .toString();
    }
New to GrepCode? Check out our FAQ X