https://github.com/brentp/go-giggle
golang wrapper to giggle
https://github.com/brentp/go-giggle
Last synced: about 2 months ago
JSON representation
golang wrapper to giggle
- Host: GitHub
- URL: https://github.com/brentp/go-giggle
- Owner: brentp
- License: apache-2.0
- Created: 2016-11-08T03:08:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-28T14:47:54.000Z (almost 8 years ago)
- Last Synced: 2025-03-29T22:11:54.734Z (3 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-giggle
---------golang wrapper to [giggle](https://github.com/ryanlayer/giggle)
[](https://godoc.org/github.com/brentp/go-giggle)
```Go
import (
giggle "github.com/brentp/go-giggle"
"fmt"
)func main() {
index := giggle.Open("/path/to/index")
res := index.Query("1", 565657, 567999)// all files in the index
index.Files()// int showing total count
res.TotalHits()// []uint32 giving number of hits for each file
res.Hits()var lines []string
# access results by index of file.
lines = res.Of(0)
fmt.Println(strings.Join(lines, "\n"))
lines = res.Of(1)
}
```setup
=====```
grep -l "int main" giggle/src/*.c | xargs -I{} rm {} giggle/src/$(basename {} .c).h
# timer start() conflicts with jsw start()
rm giggle/src/timer.h
grep -v "timer.h" giggle/src/giggle_index.c > $$.tmp; mv $$.tmp giggle/src/giggle_index.c
```