func (b *SampleSearchBuilder) EndGroup() *SampleSearchBuilder {
	b.currentOp = b.currentOp.Parent
	return b
}
EndGroup append new operant to query.
package f
import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"github.com/favclip/smg/smgutils"
	"google.golang.org/appengine/log"
	"google.golang.org/appengine/search"
	"time"
)
type SampleSearch struct {
	src *Sample
	A string
}
func (src *Sample) Searchfy() (*SampleSearch, error) {
	if src == nil {
		return nil, nil
	}
	dest := &SampleSearch{}
	dest.src = src
	var err error
	var b []byte
	b, err = json.Marshal(src.A)
	if err != nil {
		return nil, err
	}
	if str := string(b); str != "" && str != "\"\"" {
		dest.A = str
	}
	return dest, nil
}
func NewSampleSearch() *SampleSearchBuilder {
	op := &smgutils.Op{}
	b := &SampleSearchBuilder{
		rootOp:    op,
		currentOp: op,
		opts: &search.SearchOptions{
			Sort: &search.SortOptions{},
		},
	}
	b.A = &SampleSearchStringPropertyInfo{"A", b}
	return b
}
func NewSampleSearchWithIndexName(name string) *SampleSearchBuilder {
	b := NewSampleSearch()
	b.indexName = name
	return b
}
var _ smgutils.SearchBuilder = &SampleSearchBuilder{}
type SampleSearchBuilder struct {
	rootOp    *smgutils.Op
	currentOp *smgutils.Op  
	opts      *search.SearchOptions
	query     string
	indexName string
	index     *search.Index
	A         *SampleSearchStringPropertyInfo
}
func (b *SampleSearchBuilder) IndexName() string {
	if b.indexName != "" {
		return b.indexName
	}
	return "Sample"
}
func (b *SampleSearchBuilder) QueryString() (string, error) {
	buffer := &bytes.Buffer{}
	err := b.rootOp.Query(buffer)
	if err != nil {
		return "", err
	}
	return buffer.String(), nil
}
func (b *SampleSearchBuilder) SearchOptions() *search.SearchOptions {
	return b.opts
}
func (b *SampleSearchBuilder) And() *SampleSearchBuilder {
	b.currentOp.Children = append(b.currentOp.Children, &smgutils.Op{Type: smgutils.And})
	return b
}
func (b *SampleSearchBuilder) Or() *SampleSearchBuilder {
	b.currentOp.Children = append(b.currentOp.Children, &smgutils.Op{Type: smgutils.Or})
	return b
}
func (b *SampleSearchBuilder) Group(p func()) *SampleSearchBuilder {
	b.StartGroup()
	p()
	b.EndGroup()
	return b
}
func (b *SampleSearchBuilder) StartGroup() *SampleSearchBuilder {
	op := &smgutils.Op{Type: smgutils.Group, Parent: b.currentOp}
	b.currentOp.Children = append(b.currentOp.Children, op)
	b.currentOp = op
	return b
}