27f001bc14
New is now used to create new indexes Open is used to open existing indexes calls to Open no longer specify a mapping because the mapping is serialized and stored along with the index
1.3 KiB
1.3 KiB
bleve
modern text indexing in go - blevesearch.com
Features
- Index any go data structure (including JSON)
- Intelligent defaults backed up by powerful configuration
- Supported field types:
- Text, Numeric, Date
- Supported query types:
- Term, Phrase, Match, Match Phrase
- Conjunction, Disjunction, Boolean
- Numeric Range, Date Range
- Simple query syntax for human entry
- Search result match highlighting
Discussion
Discuss usage and development of bleve in the google group.
Indexing
message := struct{
From: "marty.schoch@gmail.com",
Body: "bleve indexing is easy",
}
mapping := bleve.NewIndexMapping()
index, _ := bleve.New("example.bleve", mapping)
index.Index(message)
Querying
index, _ := bleve.Open("example.bleve")
query := bleve.NewSyntaxQuery("bleve")
searchRequest := bleve.NewSearchRequest(query)
searchResult, _ := index.Search(searchRequest)