|
2 | 2 | [](https://circleci.com/gh/stevenferrer/solr-go) |
3 | 3 | [](https://coveralls.io/github/stevenferrer/solr-go?branch=master) |
4 | 4 |
|
5 | | -# solr-go |
| 5 | +# Solr-Go |
6 | 6 |
|
7 | | -[Solr](https://lucene.apache.org/solr/) client for [Go](http://go.dev/). |
| 7 | +[Solr](https://lucene.apache.org/solr/) client for [Go](http://go.dev/). |
| 8 | + |
| 9 | +```go |
| 10 | + |
| 11 | +import ( |
| 12 | + "context" |
| 13 | + // Import the package that you need |
| 14 | + solrquery "github.com/stevenferrer/solr-go/query" |
| 15 | +) |
| 16 | + |
| 17 | +func main() { |
| 18 | + // Initialize the query client |
| 19 | + queryClient := solrquery.NewClient("localhost", 8983) |
| 20 | + |
| 21 | + // Start querying! |
| 22 | + queryResp, err := queryClient.Query( |
| 23 | + context.Background(), |
| 24 | + "techproducts", // name of your collection |
| 25 | + map[string]interface{}{ |
| 26 | + "query": "{!lucene df=name v=iPod}", |
| 27 | + }, |
| 28 | + ) |
| 29 | + ... |
| 30 | +} |
| 31 | +``` |
| 32 | + |
| 33 | +## Notes |
| 34 | +* This is a *WORK IN-PROGRESS*, API might change a lot before *v1* |
| 35 | +* Currently being used in my project |
| 36 | +* Tested on [Solr 8.5](https://lucene.apache.org/solr/guide/8_5/) |
8 | 37 |
|
9 | 38 | ## Contents |
10 | 39 |
|
11 | | -- [solr-go](#solr-go) |
| 40 | +- [Solr-Go](#solr-go) |
| 41 | + - [Notes](#notes) |
12 | 42 | - [Contents](#contents) |
13 | | - - [Installation and usage](#installation-and-usage) |
| 43 | + - [Installation](#installation) |
| 44 | + - [Usage](#usage) |
14 | 45 | - [Features](#features) |
15 | 46 | - [Contributing](#contributing) |
16 | 47 |
|
17 | | -## Installation and usage |
| 48 | +## Installation |
| 49 | + |
| 50 | +You can include it in your *go.mod* by running in your terminal (assuming you're inside the project directory): |
| 51 | + |
| 52 | +```console |
| 53 | +$ go get github.com/stevenferrer/solr-go |
| 54 | +``` |
| 55 | + |
| 56 | +## Usage |
| 57 | + |
| 58 | +Detailed documentation shall follow. For now you can start looking at the examples inside each package directory. |
18 | 59 |
|
19 | | -TODO |
| 60 | +* [Index API example](./index/examples/main.go) |
| 61 | +* [Query API example](./query/example/main.go) |
| 62 | +* [Schema API example](./schema/example/main.go) |
| 63 | +* Suggester API example - TODO |
20 | 64 |
|
21 | 65 | ## Features |
22 | 66 |
|
|
46 | 90 |
|
47 | 91 | ## Contributing |
48 | 92 |
|
49 | | -This is a work in-progres, any contributions are very welcome! |
| 93 | +This is a **work in-progress**, any contributions are very welcome! |
0 commit comments