func (c *SearchController) Show(ctx *app.ShowSearchContext) error {
	var offset int
	var limit int

	offset, limit = computePagingLimts(ctx.PageOffset, ctx.PageLimit)

	// ToDo : Keep URL registeration central somehow.
	hostString := ctx.RequestData.Host
	if hostString == "" {
		hostString = c.configuration.GetHTTPAddress()
	}
	urlRegexString := fmt.Sprintf("(?P<domain>%s)(?P<path>/work-item/list/detail/)(?P<id>\\d*)", hostString)
	search.RegisterAsKnownURL(search.HostRegistrationKeyForListWI, urlRegexString)
	urlRegexString = fmt.Sprintf("(?P<domain>%s)(?P<path>/work-item/board/detail/)(?P<id>\\d*)", hostString)
	search.RegisterAsKnownURL(search.HostRegistrationKeyForBoardWI, urlRegexString)

	return application.Transactional(c.db, func(appl application.Application) error {
		//return transaction.Do(c.ts, func() error {
		result, c, err := appl.SearchItems().SearchFullText(ctx.Context, ctx.Q, &offset, &limit)
		count := int(c)
		if err != nil {
			cause := errs.Cause(err)
			switch cause.(type) {
			case errors.BadParameterError:
				jerrors, _ := jsonapi.ErrorToJSONAPIErrors(goa.ErrBadRequest(fmt.Sprintf("Error listing work items: %s", err.Error())))
				return ctx.BadRequest(jerrors)
			default:
				log.Error(ctx, map[string]interface{}{
					"err": err,
				}, "unable to list the work items")
				jerrors, _ := jsonapi.ErrorToJSONAPIErrors(goa.ErrInternal(err.Error()))
				return ctx.InternalServerError(jerrors)
			}
		}

		response := app.SearchWorkItemList{
			Links: &app.PagingLinks{},
			Meta:  &app.WorkItemListResponseMeta{TotalCount: count},
			Data:  ConvertWorkItems(ctx.RequestData, result),
		}

		setPagingLinks(response.Links, buildAbsoluteURL(ctx.RequestData), len(result), offset, limit, count, "q="+ctx.Q)
		return ctx.OK(&response)
	})
}
// Show runs the show action.
Show runs the show action.
// Show runs the show action .
func (c *SearchController) Show(ctx *app.ShowSearchContext) error {
	var offset int
	var limit int
	offset, limit = computePagingLimts(ctx.PageOffset, ctx.PageLimit)
	hostString := ctx.RequestData.Host
	if hostString == "" {
		hostString = c.configuration.GetHTTPAddress()
	}
	urlRegexString := fmt.Sprintf("(?P<domain>%s)(?P<path>/work-item/list/detail/)(?P<id>\\d*)", hostString)
	search.RegisterAsKnownURL(search.HostRegistrationKeyForListWI, urlRegexString)
	urlRegexString = fmt.Sprintf("(?P<domain>%s)(?P<path>/work-item/board/detail/)(?P<id>\\d*)", hostString)
	search.RegisterAsKnownURL(search.HostRegistrationKeyForBoardWI, urlRegexString)
	return application.Transactional(c.db, func(appl application.Application) error {
		result, c, err := appl.SearchItems().SearchFullText(ctx.Context, ctx.Q, &offset, &limit)
		count := int(c)
		if err != nil {
			cause := errs.Cause(err)
			switch cause.(type) {
			case errors.BadParameterError:
				jerrors, _ := jsonapi.ErrorToJSONAPIErrors(goa.ErrBadRequest(fmt.Sprintf("Error listing work items: %s", err.Error())))
				return ctx.BadRequest(jerrors)
			default:
				log.Error(ctx, map[string]interface{}{
					"err": err,
				}, "unable to list the work items")
				jerrors, _ := jsonapi.ErrorToJSONAPIErrors(goa.ErrInternal(err.Error()))
				return ctx.InternalServerError(jerrors)
			}
		}
		response := app.SearchWorkItemList{
			Links: &app.PagingLinks{},
			Meta:  &app.WorkItemListResponseMeta{TotalCount: count},
			Data:  ConvertWorkItems(ctx.RequestData, result),
		}
		setPagingLinks(response.Links, buildAbsoluteURL(ctx.RequestData), len(result), offset, limit, count, "q="+ctx.Q)
		return ctx.OK(&response)
	})
}
func ( c * SearchController ) Show ( ctx * app . ShowSearchContext ) error { var offset int var limit int offset , limit = computePagingLimts ( ctx . PageOffset , ctx . PageLimit ) hostString := ctx . RequestData . Host if hostString == " " { hostString = c . configuration . GetHTTPAddress ( ) } urlRegexString := fmt . Sprintf ( " \\ " , hostString ) search . RegisterAsKnownURL ( search . HostRegistrationKeyForListWI , urlRegexString ) urlRegexString = fmt . Sprintf ( " \\ " , hostString ) search . RegisterAsKnownURL ( search . HostRegistrationKeyForBoardWI , urlRegexString ) return application . Transactional ( c . db , func ( appl application . Application ) error { result , c , err := appl . SearchItems ( ) . SearchFullText ( ctx . Context , ctx . Q , & offset , & limit ) count := int ( c ) if err != nil { cause := errs . Cause ( err ) switch cause . ( type ) { case errors . BadParameterError : jerrors , _ := jsonapi . ErrorToJSONAPIErrors ( goa . ErrBadRequest ( fmt . Sprintf ( " " , err . Error ( ) ) ) ) return ctx . BadRequest ( jerrors ) default : log . Error ( ctx , map [ string ] interface { } { " " : err , } , " " ) jerrors , _ := jsonapi . ErrorToJSONAPIErrors ( goa . ErrInternal ( err . Error ( ) ) ) return ctx . InternalServerError ( jerrors ) } } response := app . SearchWorkItemList { Links : & app . PagingLinks { } , Meta : & app . WorkItemListResponseMeta { TotalCount : count } , Data : ConvertWorkItems ( ctx . RequestData , result ) , } setPagingLinks ( response . Links , buildAbsoluteURL ( ctx . RequestData ) , len ( result ) , offset , limit , count , " " + ctx . Q ) return ctx . OK ( & response ) } ) }
Show runs the show action.
Show runs the show action .
// ToDo : Keep URL registeration central somehow. //return transaction.Do(c.ts, func() error {