Skip to content

Commit

Permalink
upaated README
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoch committed Jul 31, 2014
1 parent 3eb63a8 commit 7a174d7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 6 deletions.
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# bleve
# ![bleve](docs/bleve.png) bleve

[![Build Status](https://drone.io/github.com/couchbaselabs/bleve/status.png)](https://drone.io/github.com/couchbaselabs/bleve/latest)
[![Coverage Status](https://coveralls.io/repos/couchbaselabs/bleve/badge.png?branch=master)](https://coveralls.io/r/couchbaselabs/bleve?branch=master)
modern text indexing in go

## Features
* Index any go data structure (including JSON)
* Intelligent defaults backed up by powerful configuration
* Supported field types:
* Text
* Supported query types:
* Term, Phrase, Match, Match Phrase
* Conjunction, Disjunction, Boolean
* Simple query syntax for human entry
* Search result match highlighting

## Indexing

message := struct{
From: "[email protected]",
Body: "bleve indexing is easy",
}

mapping := bleve.NewIndexMapping()
index, _ := bleve.Open("example.bleve", mapping)
index.IndexId(message)

A modern text indexing library for go.
## Querying

mapping := bleve.NewIndexMapping()
index, _ := bleve.Open("example.bleve", mapping)
query := bleve.NewSyntaxQuery("bleve")
searchRequest := bleve.NewSearchRequest(query)
searchResult, _ := index.Search(searchRequest)


## Status

[![Build Status](https://drone.io/github.com/couchbaselabs/bleve/status.png)](https://drone.io/github.com/couchbaselabs/bleve/latest)
[![Coverage Status](https://coveralls.io/repos/couchbaselabs/bleve/badge.png?branch=master)](https://coveralls.io/r/couchbaselabs/bleve?branch=master)
Binary file added docs/bleve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/bleve_query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func main() {
// build a search with the provided parameters
queryString := strings.Join(flag.Args(), " ")
query := bleve.NewSyntaxQuery(queryString)
searchRequest := bleve.NewSearchRequest(query, *limit, *skip, *explain)
searchRequest := bleve.NewSearchRequestOptions(query, *limit, *skip, *explain)

// enable highlights if requested
if *includeHighlights {
Expand Down
6 changes: 5 additions & 1 deletion search.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ func (r *SearchRequest) UnmarshalJSON(input []byte) error {

}

func NewSearchRequest(q Query, size, from int, explain bool) *SearchRequest {
func NewSearchRequest(q Query) *SearchRequest {
return NewSearchRequestOptions(q, 10, 0, false)
}

func NewSearchRequestOptions(q Query, size, from int, explain bool) *SearchRequest {
return &SearchRequest{
Query: q,
Size: size,
Expand Down

0 comments on commit 7a174d7

Please sign in to comment.