0
0

Merge pull request #528 from bfontaine/syntax

README: Use go syntax highlighting
This commit is contained in:
Marty Schoch 2017-02-04 09:52:58 -05:00 committed by GitHub
commit 50c43bfef6

View File

@ -33,6 +33,7 @@ Discuss usage and development of bleve in the [google group](https://groups.goog
## Indexing ## Indexing
```go
message := struct{ message := struct{
Id string Id string
From string From string
@ -49,13 +50,16 @@ Discuss usage and development of bleve in the [google group](https://groups.goog
panic(err) panic(err)
} }
index.Index(message.Id, message) index.Index(message.Id, message)
```
## Querying ## Querying
```go
index, _ := bleve.Open("example.bleve") index, _ := bleve.Open("example.bleve")
query := bleve.NewQueryStringQuery("bleve") query := bleve.NewQueryStringQuery("bleve")
searchRequest := bleve.NewSearchRequest(query) searchRequest := bleve.NewSearchRequest(query)
searchResult, _ := index.Search(searchRequest) searchResult, _ := index.Search(searchRequest)
```
## License ## License