Skip to content

Commit f2ebd70

Browse files
authored
Merge pull request #15 from swiftype/fancy-readme
Adds fancy README
2 parents def43f7 + 42a3832 commit f2ebd70

File tree

3 files changed

+58
-39
lines changed

3 files changed

+58
-39
lines changed

LICENSE.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.md

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
# Python Client for Swiftype Site Search API
1+
<p align="center"><img src="https://github.com/swiftype/swiftype-py/blob/master/logo-app-search.png?raw=true" alt="Elastic Site Search Logo"></p>
22

3-
[![Build Status](https://travis-ci.org/swiftype/swiftype-py.png?branch=master)](https://travis-ci.org/swiftype/swiftype-py)
3+
<p align="center"><a href="https://travis-ci.org/swiftype/swiftype-py"><img src="https://travis-ci.org/swiftype/swiftype-py.png?branch=master" alt="Travis build"></a>
4+
<a href="https://github.com/swiftype/swiftype-py/releases"><img src="https://img.shields.io/github/release/swiftype/swiftype-py/all.svg?style=flat-square" alt="GitHub release" /></a></p>
45

5-
> **Note:** This client has been developed for the [Swiftype Site Search](https://www.swiftype.com/site-search) API endpoints only. You may refer to the [Swiftype Site Search API Documentation](https://swiftype.com/documentation/site-search/overview) for additional context.
6+
> A first-party Python client for the [Elastic Site Search API](https://swiftype.com/documentation/site-search/overview).
67
7-
# Quickstart
8+
## Contents
89

9-
## Installation
10+
+ [Getting started](#getting-started-)
11+
+ [Usage](#usage)
12+
+ [Running tests](#running-tests)
13+
+ [FAQ](#faq-)
14+
+ [Contribute](#contribute-)
15+
+ [License](#license-)
16+
17+
***
18+
19+
## Getting started 🐣
1020

1121
You can install the latest version of the Swiftype client using `pip`:
1222

@@ -16,7 +26,9 @@ To install locally, clone this repository, `cd` into the directory and run:
1626

1727
python setup.py install
1828

19-
## Setup
29+
> **Note:** This client has been developed for the [Elastic Site Search](https://www.swiftype.com/site-search) API endpoints only. You may refer to the [Elastic Site Search API Documentation](https://swiftype.com/documentation/site-search/overview) for additional context.
30+
31+
## Usage
2032

2133
1. Create an account at [Swiftype](https://swiftype.com/) and get your API key from your [Account Settings](https://app.swiftype.com/settings/account).
2234

@@ -34,7 +46,7 @@ To install locally, clone this repository, `cd` into the directory and run:
3446
client.create_document_type('youtube', 'videos');
3547
client.create_document_type('youtube', 'channels');
3648

37-
## Indexing
49+
### Indexing
3850

3951
Now you need to create your `Document`s. It's very important to think about the type of each field you create a `Document`. The `DocumentType` the `Document` belongs to will remember each fields type and it is not possible to change it. The type specifies a fields features and you should choose them wisely. For details please have a look at our [Field Types Documentation](https://swiftype.com/documentation/overview#field_types).
4052

@@ -63,7 +75,7 @@ Add a `Document` to the `users` `DocumentType`:
6375
{'name': 'video_counts', 'value': 6, 'type': 'integer'}
6476
]})
6577

66-
## Searching
78+
### Searching
6779

6880
Now your `Engine` is ready to receive queries. By default, search queries will match any fields that are of type `string` or `text`. You can search each `DocumentType` individually:
6981

@@ -74,7 +86,7 @@ or search all `DocumentType`s on your `Engine` at once:
7486

7587
results = client.search('youtube', 'swiftype')
7688

77-
## Autocomplete
89+
### Autocomplete
7890

7991
Finally, as with full-text searches, you may perform autocomplete-style (prefix match) searches as well:
8092

@@ -84,9 +96,9 @@ or
8496

8597
results = client.suggest_document_type('youtube', 'videos', 'swi')
8698

87-
# API Documentation
99+
## API Documentation
88100

89-
## Configuration:
101+
### Configuration:
90102

91103
Before issuing commands to the API, configure the client with your API key:
92104

@@ -95,7 +107,7 @@ Before issuing commands to the API, configure the client with your API key:
95107

96108
You can find your API key in your [Account Settings](https://swiftype.com/user/edit).
97109

98-
## Search
110+
### Search
99111

100112
If you want to search for e.g. `swiftype` on your `Engine`, you can use:
101113

@@ -109,7 +121,7 @@ Both search methods allow you to specify options as an extra parameter to e.g. f
109121

110122
results = client.search_document_type('youtube', 'videos', 'swiftype', {'filters': {'videos': {'category': 'Tutorial'}}})
111123

112-
## Autocomplete
124+
### Autocomplete
113125

114126
Autocompletes have the same functionality as searches. You can autocomplete using all documents:
115127

@@ -123,7 +135,7 @@ or add options to have more control over the results:
123135

124136
results = client.suggest('youtube', 'swi', {'sort_field': {'videos': 'likes'}})
125137

126-
## Engines
138+
### Engines
127139

128140
Retrieve every `Engine`:
129141

@@ -141,7 +153,7 @@ To delete an `Engine` you need the `slug` or the `id` field of an `engine`:
141153

142154
client.destroy_engine('youtube')
143155

144-
## Document Types
156+
### Document Types
145157

146158
Retrieve `DocumentTypes`s of the `Engine` with the `slug` field `youtube`:
147159

@@ -163,7 +175,7 @@ Delete a `DocumentType` using the `slug` or `id` of it:
163175

164176
client.destroy_document_type('youtube', 'videos')
165177

166-
## Documents
178+
### Documents
167179

168180
Retrieve all `Document`s of `Engine` `youtube` and `DocumentType` `videos`:
169181

@@ -256,7 +268,7 @@ Destroy multiple `Document`s at once:
256268

257269
stati = client.destroy_documents('youtube','videos',['external_id2','external_id3','external_id6'])
258270

259-
## Domains
271+
### Domains
260272

261273
Retrieve all `Domain`s of `Engine` `websites`:
262274

@@ -282,7 +294,7 @@ Add or update a URL for a `Domain`:
282294

283295
client.crawl_url('websites', 'generated_id', 'https://swiftype.com/new/path/about.html')
284296

285-
## Analytics
297+
### Analytics
286298

287299
To get the amount of searches on your `Engine` in the last 14 days use:
288300

@@ -320,7 +332,7 @@ You can also specify a date range for no result queries:
320332

321333
top_no_result_queries = client.analytics_top_no_result_queries('youtube', '2013-01-01', '2013-02-01')
322334

323-
## Platform API
335+
### Platform API
324336

325337
If you've registered your service as a [Swiftype Platform Application](https://swiftype.com/documentation/users), you can use this library to create users and take actions on their behalf. (Learn more about the Platform API [here](https://swiftype.com/documentation/users).)
326338

@@ -356,3 +368,30 @@ All of the same Engine APIs documented above will work with your new `user_clien
356368

357369
pip install -r test_requirements.txt
358370
python tests/test_swiftype.py
371+
372+
## FAQ 🔮
373+
374+
### Where do I report issues with the client?
375+
376+
If something is not working as expected, please open an [issue](https://github.com/swiftype/swiftype-py/issues/new).
377+
378+
### Where can I learn more about Site Search?
379+
380+
Your best bet is to read the [documentation](https://swiftype.com/documentation/site-search).
381+
382+
### Where else can I go to get help?
383+
384+
You can checkout the [Elastic Site Search community discuss forums](https://discuss.elastic.co/c/site-search).
385+
386+
## Contribute 🚀
387+
388+
We welcome contributors to the project. Before you begin, a couple notes...
389+
390+
+ Before opening a pull request, please create an issue to [discuss the scope of your proposal](https://github.com/swiftype/swiftype-py/issues).
391+
+ Please write simple code and concise documentation, when appropriate.
392+
393+
## License 📗
394+
395+
[MIT](https://github.com/swiftype/swiftype-py/blob/master/LICENSE) © [Elastic](https://github.com/elastic)
396+
397+
Thank you to all the [contributors](https://github.com/swiftype/swiftype-py/graphs/contributors)!

logo-site-search.png

25.7 KB
Loading

0 commit comments

Comments
 (0)