parseIsQuestion check the result if only limit question or not
(query *string)
| 233 | |
| 234 | // parseIsQuestion check the result if only limit question or not |
| 235 | func (sp *SearchParser) parseIsQuestion(query *string) (isQuestion bool) { |
| 236 | var ( |
| 237 | q = *query |
| 238 | expr = `is:question` |
| 239 | ) |
| 240 | |
| 241 | if strings.Contains(q, expr) { |
| 242 | q = strings.ReplaceAll(q, expr, "") |
| 243 | isQuestion = true |
| 244 | } |
| 245 | |
| 246 | *query = strings.TrimSpace(q) |
| 247 | return |
| 248 | } |
| 249 | |
| 250 | // parseViews check search has views or not |
| 251 | func (sp *SearchParser) parseViews(query *string) (views int) { |