Created
April 4, 2013 12:45
-
-
Save dadoonet/5310075 to your computer and use it in GitHub Desktop.
Testing FSRiver with Mapper attachment and check metadata extracted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####### PREPARE TEST PLATFORM | |
### First install elasticsearch 0.20.6 | |
# curl https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.6.zip -o elasticsearch-0.20.6.zip | |
# unzip elasticsearch-0.20.6.zip | |
# cd elasticsearch-0.20.6 | |
### Install mapper attachment plugin | |
# bin/plugin -install elasticsearch/elasticsearch-mapper-attachments/1.6.0 | |
### Install FSRiver plugin | |
# bin/plugin -install fr.pilato.elasticsearch.river/fsriver/0.0.3 | |
### Start Elasticsearch | |
# bin/elasticsearch -f | |
####### START TESTS | |
### Delete index | |
curl -XDELETE 'localhost:9200/mydocs' | |
### Delete river | |
curl -XDELETE 'localhost:9200/_river/mydocs' | |
### Create mapping | |
curl -XPUT 'localhost:9200/mydocs' -d ' | |
{ | |
"doc": { | |
"properties": { | |
"file": { | |
"type": "attachment", | |
"path": "full", | |
"fields": { | |
"file": { | |
"type": "string", | |
"store": "yes", | |
"term_vector": "with_positions_offsets" | |
}, | |
"author": { | |
"type": "string", | |
"store": "yes" | |
}, | |
"title": { | |
"type": "string", | |
"store": "yes" | |
}, | |
"date": { | |
"type": "date", | |
"format": "dateOptionalTime", | |
"store": "yes" | |
}, | |
"keywords": { | |
"type": "string", | |
"store": "yes" | |
}, | |
"content_type": { | |
"type": "string", | |
"store": "yes" | |
} | |
} | |
} | |
} | |
} | |
} | |
' | |
### Create river | |
curl -XPUT 'localhost:9200/_river/mydocs/_meta' -d '{ | |
"type": "fs", | |
"fs": { | |
"name": "My tmp dir", | |
"url": "/tmp/es", | |
"update_rate": 10000, | |
"includes": "*.odt,*.pdf", | |
"excludes": "*.sh" | |
} | |
}' | |
### Wait for 2 seconds | |
sleep 2 | |
### Search | |
curl 'http://localhost:9200/mydocs/doc/_search?pretty' -d ' | |
{ | |
"fields" : ["*"], | |
"query":{ | |
"match_all" : {} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment