Merge pull request #528 from bfontaine/syntax
README: Use go syntax highlighting
This commit is contained in:
commit
50c43bfef6
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user