From 7e2ce1cf9ec967b67db8f7b2575126cfb563afe3 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Sat, 4 Feb 2017 12:20:56 +0100 Subject: [PATCH] README: Use go syntax highlighting --- README.md | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ab69a486..bf222fd9 100644 --- a/README.md +++ b/README.md @@ -33,29 +33,33 @@ Discuss usage and development of bleve in the [google group](https://groups.goog ## Indexing - message := struct{ - Id string - From string - Body string - }{ - Id: "example", - From: "marty.schoch@gmail.com", - Body: "bleve indexing is easy", - } +```go +message := struct{ + Id string + From string + Body string +}{ + Id: "example", + From: "marty.schoch@gmail.com", + Body: "bleve indexing is easy", +} - mapping := bleve.NewIndexMapping() - index, err := bleve.New("example.bleve", mapping) - if err != nil { - panic(err) - } - index.Index(message.Id, message) +mapping := bleve.NewIndexMapping() +index, err := bleve.New("example.bleve", mapping) +if err != nil { + panic(err) +} +index.Index(message.Id, message) +``` ## Querying - index, _ := bleve.Open("example.bleve") - query := bleve.NewQueryStringQuery("bleve") - searchRequest := bleve.NewSearchRequest(query) - searchResult, _ := index.Search(searchRequest) +```go +index, _ := bleve.Open("example.bleve") +query := bleve.NewQueryStringQuery("bleve") +searchRequest := bleve.NewSearchRequest(query) +searchResult, _ := index.Search(searchRequest) +``` ## License