From 581ab75d0794374abc0f4c8d50dbb16d7415ecbc Mon Sep 17 00:00:00 2001 From: Alberto Paro Date: Thu, 8 Aug 2013 23:32:11 +0200 Subject: [PATCH] Updated DjangoUtils field name --- install_es.sh | 21 ++++++++++++++++++--- performance/performance.py | 4 ++-- pyes/djangoutils.py | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/install_es.sh b/install_es.sh index ce6164ab..31c0be43 100755 --- a/install_es.sh +++ b/install_es.sh @@ -1,5 +1,20 @@ -wget -c --no-check-certificate https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.1.tar.gz -tar xfvz elasticsearch-0.90.1.tar.gz -mv elasticsearch-0.90.1 elasticsearch +wget -c --no-check-certificate https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.tar.gz +tar xfvz elasticsearch-0.90.2.tar.gz +mv elasticsearch-0.90.2 elasticsearch elasticsearch/bin/plugin -install lukas-vlcek/bigdesk -install mobz/elasticsearch-head -install elasticsearch/elasticsearch-lang-python/1.2.0 -install elasticsearch/elasticsearch-lang-javascript/1.3.0 -install elasticsearch/elasticsearch-mapper-attachments/1.7.0 -install elasticsearch/elasticsearch-transport-thrift/1.5.0 elasticsearch/bin/plugin -install elasticsearch/elasticsearch-river-twitter/1.2.0 +elasticsearch/bin/plugin -install richardwilly98/elasticsearch-river-mongodb/1.6.11 +elasticsearch/bin/plugin -url http://bit.ly/145e9Ly -install river-jdbc +{ + "type" : "mongodb", + "mongodb" : { + "servers" : [ + { "host" : "localhost", "port" : 27017 } + ], + "db" : "esbook", + "collection" : "products" + }, + "index" : { + "name" : "esbook" + } +} \ No newline at end of file diff --git a/performance/performance.py b/performance/performance.py index ff86ebfe..74b0e54a 100644 --- a/performance/performance.py +++ b/performance/performance.py @@ -6,8 +6,8 @@ from brainaetic.echidnasearch.es import ES from datetime import datetime import shelve -#conn = ES('127.0.0.1:9200') -conn = ES('192.168.2.50:9200') +conn = ES('127.0.0.1:9500') +#conn = ES('192.168.2.50:9200') try: conn.delete_index("test-index") except: diff --git a/pyes/djangoutils.py b/pyes/djangoutils.py index 7fdfc833..3e486b90 100644 --- a/pyes/djangoutils.py +++ b/pyes/djangoutils.py @@ -143,7 +143,7 @@ def serialize(self): self.pk = "TODO" self.id = self.pk result = {'_app': self._meta.app_label, - '_model': self._meta.module_name, + '_model': self._meta.model_name, '_id': self.pk} for field in self._meta.fields: result[field.attname] = getattr(self, field.attname)