diff options
| author | Robert Griesemer <gri@golang.org> | 2009-11-08 23:34:08 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2009-11-08 23:34:08 -0800 |
| commit | 7a3c85a34ef879cd6c5191721ebfeab51a94f398 (patch) | |
| tree | 8aeaceb45a1d4bb3336a7869fe319896bf8b6890 /src/cmd/godoc/godoc.go | |
| parent | 2546155a816759168ca046ad8da001e93802b86f (diff) | |
| download | golang-7a3c85a34ef879cd6c5191721ebfeab51a94f398.tar.gz | |
Addressing issue brought up by dsymonds:
- When providing alternative spellings to a query, do not
prefix it with a package qualifier as the suggestion may
not have any results. Correctly filtering is quite a bit
of work, and clicking the alternative spelling will always
also show the qualified hits if they exist (but also others).
Seems good enough for now.
- Give user feedback when the query syntax was wrong.
- Package names in search results are now links to the respective
package documentation.
- Experimented with excluding main packages and test files
from index with inconclusive results. Code is present and
can be enabled by changing a flag in the source. This needs
some more work.
R=rsc
CC=r, dsymonds
http://go/go-review/1026033
Diffstat (limited to 'src/cmd/godoc/godoc.go')
| -rw-r--r-- | src/cmd/godoc/godoc.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index eb9725350..91e21ea46 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -1088,6 +1088,7 @@ type SearchResult struct { Query string; Hit *LookupResult; Alt *AltWords; + Illegal bool; Accurate bool; } @@ -1097,7 +1098,7 @@ func search(c *http.Conn, r *http.Request) { if index, timestamp := searchIndex.get(); index != nil { result.Query = query; - result.Hit, result.Alt = index.(*Index).Lookup(query); + result.Hit, result.Alt, result.Illegal = index.(*Index).Lookup(query); _, ts := fsTree.get(); result.Accurate = timestamp >= ts; } |
