Improved introduction, added hello world
New paragraph Some abbreviation to 1st paragraph More concise phrasing Rename heading Remove repeated "Now," from Hello World Person is also a document Rephrasing of last paragraph in Hello, World Move installation to being above Hello, world Accidentally left out moving code backticks. Fixed Closes #155
This commit is contained in:
parent
602dd04f8b
commit
88ca607058
48
README.md
48
README.md
|
@ -1,9 +1,12 @@
|
||||||
Mapper Attachments Type for Elasticsearch
|
Mapper Attachments Type for Elasticsearch
|
||||||
=========================================
|
=========================================
|
||||||
|
|
||||||
The mapper attachments plugin adds the `attachment` type to Elasticsearch using [Apache Tika](http://lucene.apache.org/tika/).
|
The mapper attachments plugin lets Elasticsearch index file attachments in over a thousand formats (such as PPT, XLS, PDF) using the Apache text extraction library [Tika](http://lucene.apache.org/tika/).
|
||||||
The `attachment` type allows to index different "attachment" type field (encoded as `base64`), for example,
|
|
||||||
microsoft office formats, open document formats, ePub, HTML, and so on (full list can be found [here](http://tika.apache.org/1.10/formats.html)).
|
In practice, the plugin adds the `attachment` type when mapping properties so that documents can be populated with file attachment contents (encoded as `base64`).
|
||||||
|
|
||||||
|
Installation
|
||||||
|
------------
|
||||||
|
|
||||||
In order to install the plugin, run:
|
In order to install the plugin, run:
|
||||||
|
|
||||||
|
@ -35,7 +38,44 @@ plugin --install mapper-attachments \
|
||||||
--url file:target/releases/elasticsearch-mapper-attachments-X.X.X-SNAPSHOT.zip
|
--url file:target/releases/elasticsearch-mapper-attachments-X.X.X-SNAPSHOT.zip
|
||||||
```
|
```
|
||||||
|
|
||||||
Using mapper attachments
|
Hello, world
|
||||||
|
------------
|
||||||
|
|
||||||
|
Create a property mapping using the new type `attachment`:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
POST /trying-out-mapper-attachments
|
||||||
|
{
|
||||||
|
"mappings": {
|
||||||
|
"person": {
|
||||||
|
"properties": {
|
||||||
|
"cv": { "type": "attachment" }
|
||||||
|
}}}}
|
||||||
|
```
|
||||||
|
|
||||||
|
Index a new document populated with a `base64`-encoded attachment:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
POST /trying-out-mapper-attachments/person/1
|
||||||
|
{
|
||||||
|
"cv": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Search for the document using words in the attachment:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
POST /trying-out-mapper-attachments/person/_search
|
||||||
|
{
|
||||||
|
"query": {
|
||||||
|
"query_string": {
|
||||||
|
"query": "ipsum"
|
||||||
|
}}}
|
||||||
|
```
|
||||||
|
|
||||||
|
If you get a hit for your indexed document, the plugin should be installed and working.
|
||||||
|
|
||||||
|
Usage
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
Using the attachment type is simple, in your mapping JSON, simply set a certain JSON element as attachment, for example:
|
Using the attachment type is simple, in your mapping JSON, simply set a certain JSON element as attachment, for example:
|
||||||
|
|
Loading…
Reference in New Issue