Tagged Questions
-1
votes
0answers
21 views
UnicodeEncodeError: 'ascii' codec can't encode character u'\u200b' in position 150: ordinal not in range(128)
When I run the following code i receive the error message in the title. The entire code has been added.
I read that I have to include the following code but i cant figure out where.
.decode("utf-8")
...
0
votes
0answers
24 views
indexing json files through elasticsearch-py client
How do i index json files through the elasticsearch python client ?
I have indexed it with the curl command shown below and it is working fine.
curl -X POST "localhost:9200/test/attachment/" -d ...
0
votes
1answer
15 views
Sort a Huge Number of Documents in Elasticsearch
When I would like to retrieve a huge number of documents from elasticsearch index, I always use scan and scroll technique from elasticsearch ...
0
votes
0answers
15 views
Elasticsearch python client couldn't be deepcopied
I get an error TypeError: object.__new__(_thread.lock) is not safe, use _thread.lock.__new__() when I try to make deepcopy of object with elasticsearch client instance in it.
I have following code:
...
0
votes
1answer
114 views
elasticsearch exceptions ConnectionError
I am making a Django app. It uses Haystack with elasticsearch as backend.
When I run ./manage.py rebuild_index, I get this error:
elasticsearch.exceptions.ConnectionError: ...
-1
votes
1answer
20 views
Django + Haystack + ElasticSearch advanced lookup
I'm having trouble in resolving Haystack queries using SQ, objects. If I'm performing the same query but using Django ORM and it's Q objects, everything works fine.
I can't figure out what I'm doing ...
1
vote
1answer
70 views
Logging using elasticsearch-py
I would like to log my python script that uses elasticsearch-py. In particular, I want to have three logs:
General log: log INFO and above both to the stdout and to a file.
ES log: only ES related ...
0
votes
0answers
18 views
Elasticsearch stop unexpected
I have a strange problem with elasticsearch. The problem is that the service stop working unexpected. There is nothing in the log files (neither in the gunicorn log files nor elasticsearch.log ). ...
0
votes
1answer
65 views
Connecting to ES using python script
I am trying to connect and retrieve data from a ES engine.
I am using the following script:
from elasticsearch import Elasticsearch as ES
print "Setup connection..."
...
0
votes
2answers
22 views
ElasticSearch-Haystack: Spanish Tokenizer “Fails”
I'm using:
Haystack - 2.1.0
ElasticSearch - 0.90.3
pyelasticsearch - 0.6
I've configured a custom backend to change default Elasticsearch settings and use Spanish analyzer.
I'm using ...
0
votes
1answer
27 views
Elastic Search Lucene Query by Time in Python
I am having a hardtime querying Elastic Search using Kibana and Python pyes library.
https://pyes.readthedocs.org/en/latest/index.html
I need to get all the data filtered by a certain field with the ...
0
votes
0answers
15 views
Haystack: Set analyzer in “def prepare” (MultiLanguage)
Im wondering if it's possible to set the analyzer of a field in the def prepare function.
I know that you can create fields direclty in def prepare, without defining them in the index something like:
...
1
vote
1answer
38 views
Creating DataFrame from ElasticSearch Results
I am trying to build a DataFrame in pandas, using the results of a very basic query to ElasticSearch. I am getting the Data I need, but its a matter of slicing the results in a way to build the ...
0
votes
1answer
22 views
Django haystack related name search
so i have the following models:
class Article(models.Model, PublicationMixin):
publication = models.ForeignKey('Publication', related_name="articles")
...
class Publication(models.Model, ...
0
votes
0answers
25 views
Django + Haystack + Elasticsearch: How do I ignore query syntax?
I'm using Haystack with the Elasticsearch backend, and I'd like to make a query in which the user can use words like and, or and not without them being parsed as query syntax. Here's what I'm using so ...
0
votes
1answer
51 views
elasticsearch scrolling using python client
When scrolling in elasticsearch it is important to provide at each scroll the latest scroll_id:
The initial search request and each subsequent scroll request returns
a new scroll_id — only the ...
1
vote
1answer
36 views
Format the output of elasticsearch-py
I'm trying to use the python client for elasticsearch. Here is a minimal example:
import logging
logging.basicConfig()
from elasticsearch import Elasticsearch as ES
print "Setup connection..."
...
1
vote
1answer
28 views
ElasticSearch doesn't return hits when making consecutive calls - Python
For example when I have ids lookup and want to search one by by one to see if the document already exists or not. One of two things happen:
First -> first search request returns the correct doc and ...
-1
votes
1answer
61 views
Elasticsearch unlimited size
I am listening a traffic and inserting these traffic's data to elasticsearch continually.
And I want to search these datas with my python script.
Here is small part of my python code,
test = ...
0
votes
1answer
47 views
“exceptions.TypeError: list indices must be integers not str” in python with Elasticsearch
I try to obtain the id of document with my function, but I've got this error:
var = data['hits']['hits']['_id']
exceptions.TypeError: list indices must be integers, not str
my little function:
...
0
votes
2answers
37 views
pyes creates Python objects with colons in their names, can't address
I imagine I'm missing something really obvious here, but somehow I can't quite get it -- I'm using pyes to query an ElasticSearch endpoint pretty straightforwardly, so that I can then access the ...
4
votes
1answer
111 views
Elasticsearch: How to find unassigned shards and assign them?
I got 1 node, 1 shard, 1 replica architecture on my low-sources hardware configured machine. I have to keep Elasticsearch heap size at 20% of total memory and I index 1k~1m documents to Elasticsearch ...
0
votes
2answers
25 views
Elasticsearch and Python: get total variable
I use the python API of ES in order send request, I try to get the result of my answer, but it's wrong.
I use this code:
import elasticsearch
es = ...
0
votes
1answer
150 views
What causes "elasticsearch.exceptions.ConnectionError: ConnectionError … error('getaddrinfo() argument 2 must be integer or string',)))
With this minimal code:
import elasticsearch
es = elasticsearch.Elasticsearch([{u'host': u'127.0.0.1', u'port': u'9200'}])
# then do anything involving a connection, eg:
...
1
vote
1answer
38 views
Double request with pycurl on ElasticSearch
I decided to code a short python programme who used mysql and ElasticSearch.
When my rowcount return more one result, my seconde query of ElasticSearch doesn't work.
this is my code:
...
0
votes
0answers
149 views
Kibana Dashboard Time filter option is not working
I have configured Kibana dashboard for expose elastic search data and seems default dashboard is working fine but Time range filter not working.
I did custom dashboard with specified my timestamp ...
0
votes
2answers
22 views
Haystack index on attribute inherited by model
I have a problem filtering on indexes in Haystack (Elasticsearch) when model_attr refers to an inherited attribute.
For instance, with the code:
django models.py
Parent(models.Model):
...
1
vote
1answer
50 views
NgramField not working if BooleanField is present… Haystack + Elasticsearch wierd issue
I am having a very strange behavior with EdgeNgramField in Haystack with Elasticsearch.
Basically. If I have a BooleanField in my index, all Ngram and EdgeNgram fields work just like regular ...
0
votes
0answers
44 views
Django-haystack elasticsearch
I wrote a custom search backend for django-elasticsearch.
It's goal is to find places with starting name.
It works but apart from that it does not support queries which contains spaces.
So for ...
1
vote
0answers
78 views
Elasticsearch Thrift client time-out
Sorry for cross posting.The following question is also posted on Elastic Search's google group.
I am trying to index some documents in elasticsearch 1.2.0 using thrift connection in python client on ...
3
votes
1answer
108 views
How to use “suggest” in elasticsearch pyes?
How to use the "suggest" feature in pyes? Cannot seem to figure it out due to poor documentation. Could someone provide a working example? None of what I tried appears to work. In the docs its listed ...
0
votes
1answer
29 views
How to find any information in elasticsearch result
I use the python in order to integrate Elasticsearch into my programme.
I use pycurl and I manage to add, modify and delete any documents, but now i would like to test if one document exist. I wrote a ...
1
vote
1answer
135 views
Python not finding elasticsearch package
I just installed with pip install elasticsearch the right package, but is not being found by my .py script.
I have this right now:
ls /Library/Python/2.7/site-packages
README ...
0
votes
1answer
200 views
Elasticsearch Python API
I am trying to use Python API "pyes" to handel elasticsearch but I could not get it up the first time, i am running the following code:
import pyes
conn = pyes.ES('127.0.0.1:9200')
...
6
votes
1answer
227 views
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 ...
0
votes
1answer
29 views
Matching only some words in query using Django Haystack
I am currently using the following django-haystack code to do searches on my site:
def products_search_results(request):
q = request.GET['q']
from haystack.query import SearchQuerySet
...
0
votes
2answers
32 views
Querying a second model with django haystack
I would like to add a field from a second model to a django-haystack query. I have two models that have the following structure:
class Product(models.Model):
created_date = ...
0
votes
0answers
32 views
How to add a simple search bar to my app using haystack and elasticsearch in web2py?
So I am trying to add a very simple search bar for my models. Here is my models file:
db = DAL('sqlite://storage.sqlite',
pool_size=1, check_reserved=['all'],
migrate_enabled=True, ...
0
votes
2answers
46 views
How to make a valid format JSON in python?
I want to make JSON to get queries from elastic search. I'm usgin this code to build the query:
search_doc = {}
search_doc.update({"sort": [{"re_max": {"order": "desc"}}]})
...
0
votes
1answer
26 views
Django Haystack Elastic Search maximum value for indexable CharField
I was wondering whats the maximum value for an indexable CharField in Django Haytack with elasticsearch?
I am asking this, because I am getting a timeout when I try to index a specific charfield that ...
1
vote
2answers
59 views
Django Haystack Memory Error
So i am using Django Haystack with Elastic Search, and right now i am trying to rebuild_index or update_index for 55149 files and i am getting a Memory Error. I assume its because they are too many ...
1
vote
1answer
118 views
Full text search with Python
I have a huge HTML file with text, tables and images (with alt info). I have a full text search function only for this file, but at the moment I use a strict way with string comparison. I want to ...
1
vote
1answer
42 views
pyes 'from' keyword can't be set
Since from is a special python keyword I am not able to pass it pyes.es.search function. It give syntax error. pyes.es.search(maf, "twitter", "tweet", sort="timestamp", size=2, from=3) . I passed ...
1
vote
1answer
91 views
Django Haystack Elasticsearch returning everything on development server but works in shell
After installing elasticsearch server in my local machine and running development server, I have found out that any query returns every index. However, when I check in shell to make sure everything is ...
0
votes
1answer
30 views
Get all available filters in queryset
I am building a search page using elastic search and Django Haystack. What I am looking to achieve is to show filters form on the results page, but I am trying to make this more dynamic so am ...
0
votes
0answers
186 views
How to connect to a specific cluster in Elasticsearch with python API
I have 2 elasticsearch clusters (not nodes) I would like to access using the python official api.
I have changed Cluster lines in config files of each elasticsearch clusters:
cluster.name: ...
0
votes
1answer
27 views
Python PyES and and index to insert
New to PyES..documentation is somewhat hard to read..
I want to index data into ES and I see this:
conn.index({"name":"Joe Tester", "parsedtext":"Joe Testere nice guy", "uuid":"11111", ...
0
votes
0answers
54 views
Having trouble getting “more like this” to return any results in Haystack using Elastic Search backend
I don't seem to be able to get the more_like_this tag in Haystack to return any results. Not sure if it's down to the data I've input, but I've tried it with some documents that should very similar.
...
1
vote
1answer
313 views
ElasticSearch high number of index causes OOM
I've been struggling with this problem for quite a bit and now I decided to post a question on the topic to seek for some advice.
I'm testing the environment for indexing a big number of data over ...
0
votes
1answer
55 views
How to submit a query in pyES?
I have the following Python code to query an ElasticSearch index. No matter what query I try, I get an empty resultset. I seem to be missing some basic trick here.
import sys
import pyes
from ...