python - CentOS 6.4 + Haystack (2.1.0) + ElasticSearch (1.2.1) = SearchParseException ... Parse Failure -
python - CentOS 6.4 + Haystack (2.1.0) + ElasticSearch (1.2.1) = SearchParseException ... Parse Failure -
versions:
centos - 6.4 (final) haystack - 2.1.0 elasticsearch - 1.2.1 java - 1.7.0_55 django-cms - 2.3.1 pyelasticsearch - 0.6
i'm having problems using elasticsearch in django project in centos machine. i'm used configure elasticsearch/haystack in ubuntu machines, , never had issue this.
i receive error parse failure [no parser element [𠁥y]]
, have empty index. tried know error came from, tried:
at first thought error caused content of index, info trying index, after delete/clear index still got same error.
i'm trying show empty query set in template (because don't know else seek figure out problem is)
additional information
when open django shell python manage.py shell
, create
from haystack.query import searchqueryset searchqueryset() searchqueryset().all() searchqueryset().filter(content='any_text')
that kind of querys runs without problems, , homecoming empty queryset if don't find anything, or returns queryset if finds something. error , issue when trying utilize commands in view , homecoming result template. in shell works normal, if index empty homecoming empty queryset, if index has values homecoming values has return
search_indexes.py
import datetime haystack import indexes django.contrib.auth.models import user cms.models import cmsplugin, page class cmspluginindex(indexes.searchindex, indexes.indexable): text = indexes.charfield(document=true, use_template=true) plugin_type = indexes.charfield(model_attr='plugin_type') language = indexes.charfield(model_attr='language') def get_model(self): homecoming cmsplugin def index_queryset(self, using=none): """used when entire index model updated.""" homecoming self.get_model().objects.all()
cms_plugin_text.txt
{{object.language}} # added field create sure not content of
resume of views.py
def search_query(request): sqs = searchqueryset().all() homecoming httpresponse(sqs)
django error
invalid json returned es: <response [404]> exception value: invalid json returned es: <response [404]>
full elasticsearch error trace in console
[debug][action.search.type] [futurist] [haystack][2], node[inisr695rtgz_wnenkrr1w], [p], s[started]: failed execute [org.elasticsearch.action.search.searchrequest@28cfe3d9] lastshard [true] org.elasticsearch.search.searchparseexception: [haystack][2]: from[-1],size[-1]: parse failure [failed parse source [{"\ud900\udc71\ud840\udc65y\u0000\ud840\udc61": {"\uda00\udc66\ud8c0\udc6c\ud840\udc65\ud8c0\udc65\ud8c0\udc00a\uda00\udc42\udac0\udc65": {"\uda00\udc66\ud8c0\udc6c\ud840\udc65\u0000\ud880\udc25\udbc0\udc20": {"\ud800\udc66\ud900\udc75\uda00\udc72\u0000\ud880\udc25\ud8c0\udc20": {"\ud900\udc71\ud840\udc65y\u0000\ud840\udc61": {"\ud900\udc71\ud840\udc65\udb80\udc79\ud8c0\udc73\uda00\udc72\ud980\udc6e\u0000\u0000\uda00 \udc64\ud8c0\udc73\udb40\udc61\ud900\udc63": {"\ud900\udc71\ud840\udc65y\u0000\ud840\udc61": "\uda40\udc64\udb40\udc61\udb80\udc67\ud880\udc5f\uda40\udc74\ud880\udc28\ud880\udc6d\ud880\ udc2e\ud880\udc6d\udac0\udc70\ud980\udc75\udb40\udc69\udb80\udc20\udbc0\udc52\ud840\udc70\ud b40\udc6f\uda80\udc6f\udac0\udc61\ud880\udc5f\ud800\udc68\ud900\udc72\udb40\udc64\udb80\udc6 3\udb40\udc75\ud840\udc74\uda00\udc79\ud880\udc00\u0000\u0002\u0000\uda34\ude80\u7f8ed\u0000 \udbbf\udfff\udbbf\udfff\u0000\ud917\udc22\udbcc\udc38\ud899\udc75\ud917\udc36\udbcc\udc39\u d899\udc75\ud917\udc35\udbcc\udc61\ud899\udc75\ud917\udc32\udbcc\udc30\ud9d9\udc75\ud917\udc 30\ud90c\ude63\ud9d9\udc75"}}, "\ud880\udc5f\ud880\udc61\ud900\udc68\u0000\udb80\udc70\udb40\udc69": true}}, "\ud900\udc71\ud840\udc65y\u0000\ud840\udc61": {"\ud900\udc71\ud840\udc65\udb80\udc79\ud8c0\udc73\uda00\udc72\ud980\udc6e\u0000\u0000\uda00 \udc64\ud8c0\udc73\udb40\udc61\ud900\udc63": {"\ud900\udc71\ud840\udc65y\u0000\ud840\udc61": "\ud900\udc28)\ud89d\udc30", "\ud900\udc64\ud800\udc66\udac0\udc75\udb80\udc74\udbc0\udc6f\ud840\udc65\ud8c0\udc61\ud840\ udc6f\u0000\ud99b\udf6c\udb40\udc61\udac0\udc61\uda40\udc79\udb80\udc65\uda00\udc77\ud8c0\ud c6c": "\udb40\udc41d\ud8c0\udc67", "\ud900\udc64\ud800\udc66\udac0\udc75\udb80\udc74\uda00\udc66\udac0\udc65d\u0000\u0001\u0000 \uda18\ude40\u7f8e\u0001": "\ud900\udc74\ud8c0\udc78\udbc0\udc00\udb00\udc65", "\ud900\udc61\udb80\udc74\ud980\udc5f\udb40\udc65\ud840\udc65\ud8c0\udc61\udb80\udc65\ud9c0\ udc70\ud800\udc72\ud900\udc73\ud800\udc5f\ud900\udc75\uda00\udc72\ud880\udc65\ud8c0\udc00\u7 36c\u0000\u0000\udba4\udc30\u7f8e\udbbf\udffe\udbbf\udfff\u0001\u0000\u0001\u0000\uda38\ude8 0\u7f8e": true, "\udb40\udc61\udac0\udc61\uda40\udc79\udb80\udc65\uda00\udc77\ud8c0\udc6c\ud800\udc63\ud8c0\ udc72\ud880\udc00\u7f8e\b\u0000\uda34\ude80\u7f8e\u0003\u0000": true}}}}, "\ud840\udc66\udb00\udc6f\ud840\udc00\u7f8e": 0, "\uda00\udc73\ud900\udc7a\u0000\u0000": 20}]] @ org.elasticsearch.search.searchservice.parsesource(searchservice.java:634) @ org.elasticsearch.search.searchservice.createcontext(searchservice.java:507) @ org.elasticsearch.search.searchservice.createandputcontext(searchservice.java:480) @ org.elasticsearch.search.searchservice.executequeryphase(searchservice.java:252) @ org.elasticsearch.search.action.searchservicetransportaction.sendexecutequery(searchservicetransportaction.java:202) @ org.elasticsearch.action.search.type.transportsearchquerythenfetchaction$asyncaction.sendexecutefirstphase(transportsearchquerythenfetchaction.java:80) @ org.elasticsearch.action.search.type.transportsearchtypeaction$baseasyncaction.performfirstphase(transportsearchtypeaction.java:216) @ org.elasticsearch.action.search.type.transportsearchtypeaction$baseasyncaction.performfirstphase(transportsearchtypeaction.java:203) @ org.elasticsearch.action.search.type.transportsearchtypeaction$baseasyncaction$2.run(transportsearchtypeaction.java:186) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:744) caused by: org.elasticsearch.search.searchparseexception: [haystack][3]: from[-1],size[-1]: parse failure [no parser element [𠁥y]] @ org.elasticsearch.search.searchservice.parsesource(searchservice.java:620) ... 11 more
if need other info figure out whats happening here, don't hesitate asking , i'll post asap.
i'm thinking maybe problem comes pyelasticsearch
. have issue similar ?
edit
i've tried thing, installed elasticsearch in ubuntu server , create querys centos ubuntu. i'm indexing cmsplugin
model django-cms, , seems body/text of plugins contains special characters , java or elasticsearch fails trying parse. first string create elasticsearch/java crashes \ud900\udc71\ud840\udc65y\u0000\ud900\udc74
.
i tried in python console
c=u'\ud900\udc71\ud840\udc65y\u0000\ud900\udc74' print c
output: 𠁥y
edit 2
i'm wondering if maybe java on centos having issue, i've tried downgrading java version 1.6 , didn't worked
edit 3
right i'm working straight elasticsearch, making querys using urllib2 elasticsearch, avoiding work haystack. elasticsearch reply queries perfect (i have manage json). supose issue how haystack generating or parsing querys, because when seek utilize searchqueryset()
, create searchqueryset().filter(content='whatever')
using shell or in view, elasticsearch crashes error above, works when doing curl
edit 4
finally i'm working straight lastly elasticsearch without using haystack. seems issue how haystack/pyelasticsearch format queries send es, cannot parse encoding , fails in each request.
i didn't found solution, avoid work haystack, if can point solution great, send e-mail haystack people see if they've noticed issue.
edit 5
if has configured haystack on centos appreciate guide configuration , versions of software. have elasticsearch running on centos i'm managing queries straight through elasticsearch, ignoring haystack completely
i believe problem here may utilize of pyelasticsearch. newer django-haystack (i believe >1.0) need utilize elasticsearch-py instead. if seek pip install elasticsearch
should install latest library (1.1.1) , prepare problem. additional "just in case" measure, seek removing pyelasticsearch pip uninstall pyelasticsearch
. dependency shown in non-obvious note, here: http://django-haystack.readthedocs.org/en/latest/installing_search_engines.html#elasticsearch
python django elasticsearch centos django-haystack
Comments
Post a Comment