func (qp *QueryParserBase) booleanQuery(clauses []*search.BooleanClause) (search.Query, error) {
	return qp.booleanQueryDisableCoord(clauses, false)
}
L676
/*
Factory method for generating query, given a set of clauses.
By default creates a boolean query composed of clauses passed in.

Can be overridden by extending classes, to modify query being
returned.
package classic
import (
	"errors"
	"fmt"
	"github.com/balzaczyy/golucene/core/analysis"
	"github.com/balzaczyy/golucene/core/search"
	"strings"
)
const (
	CONJ_NONE = iota
	CONJ_AND
	CONJ_OR
)
const (
	MOD_NONE = 0
	MOD_NOT  = 10
	MOD_REQ  = 11
)
type QueryParserBaseSPI interface {
	ReInit(CharStream)
	TopLevelQuery(string) (search.Query, error)
}
type QueryParserBase struct {
	*QueryBuilder
	spi QueryParserBaseSPI
	operator Operator
	field      string
	phraseSlop int
	autoGeneratePhraseQueries bool
}
func newQueryParserBase(spi QueryParserBaseSPI) *QueryParserBase {
	return &QueryParserBase{
		QueryBuilder: newQueryBuilder(),
		spi:          spi,
		operator:     OP_OR,
	}
}
func (qp *QueryParserBase) Parse(query string) (res search.Query, err error) {
	qp.spi.ReInit(newFastCharStream(strings.NewReader(query)))
	if res, err = qp.spi.TopLevelQuery(qp.field); err != nil {
		return nil, errors.New(fmt.Sprintf("Cannot parse '%v': %v", query, err))
	}
	if res != nil {
		return res, nil
	}
	return qp.newBooleanQuery(false), nil
}
func (qp *QueryParserBase) addClause(clauses []*search.BooleanClause,
	conj, mods int, q search.Query) []*search.BooleanClause {
	var required, prohibited bool
	if len(clauses) > 0 && conj == CONJ_AND {
		panic("not implemented yet")
	}
	if len(clauses) > 0 && qp.operator == OP_AND && conj == CONJ_OR {
		panic("not implemented yet")
	}
	if q == nil {
		return clauses
	}
	if qp.operator == OP_OR {
		prohibited = (mods == MOD_NOT)
		required = (mods == MOD_REQ)
		if conj == CONJ_AND && !prohibited {
			required = true
		}
	} else {
		panic("not implemented yet")
	}
	if required {
		panic("not implemented yet")
	} else if !prohibited {
		return append(clauses, qp.newBooleanClause(q, search.SHOULD))
	} else {
		panic("not implemented yet")
	}
}
func (qp *QueryParserBase) fieldQuery(field, queryText string, quoted bool) search.Query {
	return qp.newFieldQuery(qp.analyzer, field, queryText, quoted)
}
func (qp *QueryParserBase) newFieldQuery(analyzer analysis.Analyzer,
	field, queryText string, quoted bool) search.Query {
	var occur search.Occur
	if qp.operator == OP_AND {
		occur = search.MUST
	} else {
		occur = search.SHOULD
	}
	return qp.createFieldQuery(analyzer, occur, field, queryText,
		quoted || qp.autoGeneratePhraseQueries, qp.phraseSlop)
}
func (qp *QueryParserBase) newBooleanClause(q search.Query, occur search.Occur) *search.BooleanClause {
	return search.NewBooleanClause(q, occur)
}