code: func (q *SearchQuery) plannedQuery(expr *SearchQuery) *SearchQuery {
  	pq := new(SearchQuery)
  	*pq = *q
  	if expr != nil {
  		pq.Constraint = expr.Constraint
  		if expr.Sort != 0 {
  			pq.Sort = expr.Sort
  		}
  		if expr.Limit != 0 {
  			pq.Limit = expr.Limit
  		}
  	}
  	if pq.Sort == UnspecifiedSort {
  		if pq.Constraint.onlyMatchesPermanode() {
  			pq.Sort = CreatedDesc
  		}
  	}
  	if pq.Limit == 0 {
  		pq.Limit = 200 // arbitrary
  	}
  	if err := pq.addContinueConstraint(); err != nil {
  		log.Printf("Ignoring continue token: %v", err)
  	}
  	pq.Constraint = optimizePlan(pq.Constraint)
  	return pq
  }
docs: // exprQuery optionally specifies the *SearchQuery prototype that was generated
  // by parsing the search expression