You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.3 KiB

  1. # ![bleve](docs/bleve.png) bleve
  2. [![Build Status](https://travis-ci.org/blevesearch/bleve.svg?branch=master)](https://travis-ci.org/blevesearch/bleve) [![Coverage Status](https://coveralls.io/repos/blevesearch/bleve/badge.png?branch=master)](https://coveralls.io/r/blevesearch/bleve?branch=master) [![GoDoc](https://godoc.org/github.com/blevesearch/bleve?status.svg)](https://godoc.org/github.com/blevesearch/bleve)
  3. [![Join the chat at https://gitter.im/blevesearch/bleve](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/blevesearch/bleve?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
  4. [![codebeat](https://codebeat.co/badges/38a7cbc9-9cf5-41c0-a315-0746178230f4)](https://codebeat.co/projects/github-com-blevesearch-bleve)
  5. [![Go Report Card](https://goreportcard.com/badge/blevesearch/bleve)](https://goreportcard.com/report/blevesearch/bleve)
  6. modern text indexing in go - [blevesearch.com](http://www.blevesearch.com/)
  7. Try out bleve live by [searching the bleve website](http://www.blevesearch.com/search/?q=bleve).
  8. ## Features
  9. * Index any go data structure (including JSON)
  10. * Intelligent defaults backed up by powerful configuration
  11. * Supported field types:
  12. * Text, Numeric, Date
  13. * Supported query types:
  14. * Term, Phrase, Match, Match Phrase, Prefix
  15. * Conjunction, Disjunction, Boolean
  16. * Numeric Range, Date Range
  17. * Simple query [syntax](http://www.blevesearch.com/docs/Query-String-Query/) for human entry
  18. * tf-idf Scoring
  19. * Search result match highlighting
  20. * Supports Aggregating Facets:
  21. * Terms Facet
  22. * Numeric Range Facet
  23. * Date Range Facet
  24. ## Discussion
  25. Discuss usage and development of bleve in the [google group](https://groups.google.com/forum/#!forum/bleve).
  26. ## Indexing
  27. message := struct{
  28. Id string
  29. From string
  30. Body string
  31. }{
  32. Id: "example",
  33. From: "marty.schoch@gmail.com",
  34. Body: "bleve indexing is easy",
  35. }
  36. mapping := bleve.NewIndexMapping()
  37. index, err := bleve.New("example.bleve", mapping)
  38. if err != nil {
  39. panic(err)
  40. }
  41. index.Index(message.Id, message)
  42. ## Querying
  43. index, _ := bleve.Open("example.bleve")
  44. query := bleve.NewQueryStringQuery("bleve")
  45. searchRequest := bleve.NewSearchRequest(query)
  46. searchResult, _ := index.Search(searchRequest)
  47. ## License
  48. Apache License Version 2.0