You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: document_search_result.go
    path of file: ./repos/BookStack/models
    
    the code of the file until where you have to start completion: package models

import (
	"fmt"
	"strconv"
	"strings"
	"time"

	"github.com/astaxie/beego/orm"
)

type DocumentSearchResult struct {
	DocumentId   int       `json:"doc_id"`
	BookId       int       `json:"book_id"`
	DocumentName string    `json:"doc_name"`
	Identify     string    `json:"identify"` // Identify 文档唯一标识
	Description  string    `json:"description"`
	Author       string    `json:"author"`
	BookName     string    `json:"book_name"`
	BookIdentify string    `json:"book_identify"`
	ModifyTime   time.Time `json:"modify_time"`
	CreateTime   time.Time `json:"create_time"`
}

// 文档结果
type DocResult struct {
	DocumentId   int       `json:"doc_id"`
	DocumentName string    `json:"doc_name"`
	Identify     string    `json:"identify"` // Identify 文档唯一标识
	Release      string    `json:"release"`  // Release 发布后的Html格式内
    
func (m *DocumentSearchResult) GetDocsById(id []int, withoutCont ...bool) (docs []DocResult, err error) {
	if len(id) == 0 {
		return
	}

	var idArr []string
	for _, i := range id {
		idArr = append(idArr, fmt.Sprint(i))
	}

	fields := []string{
		"d.document_id", "d.document_name", "d.identify", "d.vcnt", "d.create_time", "b.book_id",
	}

	// 不返回内容
	if len(withoutCont) == 0 || !withoutCont[0] {
		fields = append(fields, "b.identify book_identify", "d.release", "b.book_name")
	}

	sqlFmt := "select " + strings.Join(fields, ",") + " from md_documents d left join md_books b on d.book_id=b.book_id where d.document_id in(%v)"
	sql := fmt.Sprintf(sqlFmt, strings.Join(idArr, ","))

	var rows []DocResult
	var cnt int64

	cnt, err = orm.NewOrm().Raw(sql).QueryRows(&rows)
	if cnt > 0 {
		docMap := make(map[int]DocResult)
		for _, row := range rows {
			docMap[row.DocumentId] = row
		}
		client := NewElasticSearchClient()
		for _, i := range id {
			if doc, ok := docMap[i]; ok {
				doc.Release = client.html2Text(doc.Release)
				docs = append(docs, doc)
			}
		}
	}

	return
}