I have a test that does the following:
create an index on ES using pyes
insert mapping
insert data
query the data to check if it fits the expected result
However when I run this test, sometimes it would find no result, and sometimes it would find something but some data is missing. The interesting thing is this only happens when I run the test automatically. If I type in the code ling-by-line, everything works as expected. I've tested it 3 times manually and it works without failure.
Sometimes I've even received this message:
NoServerAvailable: list index out of range
It seems like the index was not created at all
I've pinged my ES address and everything looks correct. There was no other error msg found anywhere.
I thought it would be because I was trying to get the data too fast after the insert, as documented here: Elastic Search No server available, list index out of range
(check first comment in the accepted answer)
However, even if I make it delay for 4 seconds or so, this problem still happens. What concerns me is the fact that sometimes only SOME data is missing, which is really strange. I thought it would be either finding it all or missing it all.
Anyone got similar experience that can shine some light on this issue? Thanks.
Elasticsearch is Near Realtime(NRT). It might take upto 1 second to make your recently indexed document be visible/available for search.
To make your recently indexed document available instantly for searching, you can append ?refresh=wait_for at the end of the index document command. For e.g.,
POST index/type?refresh=wait_for
{
"field1":"test",
"field2":2,
"field3":"testing"
}
?refresh=wait_for will forcibly refresh your index to make the recently indexed document available for search. Refer ?refresh.
Related
I keep getting Err:508 or #Name? (Err:525) when opening a spreadsheet created with odfpy and putting a formula in a cell with the following code:
tc = TableCell( valuetype="string", formula=calc, value=0 )
In the spreadsheet, the formula looks fine, and any edit to it together with reverting the edit, so there is no net change to the formula, makes it think it has changed, re-evaluates it, and it works fine. But not until it is tweaked. What am I missing?
Here's the formula I'm using, in case that is relevant:
=TEXT(NOW()+0*LEN(CONCAT(A2:F999));"YYYY.MM.DD.HH.MM.SS")
(purpose, to timestamp the most recent edit to a range of cells). I note that at the time the formula is inserted in row 1, that other rows haven't been inserted yet, but a few are in subsequent steps. But I wouldn't think any attempt to evaluate the range would occur until loaded into LibreOffice, so that doesn't seem a likely cause of the error.
I already am using ; not , in the function parameters, which seems to be the most successful answer for other people that encounter this error, and I'm using the English install, which is the other seeming issue some have with copy/pasting formulas. But still no joy, and not much that is relevant shows up in searching.
Well, this is weird, but probably documented somewhere.
The most helpful thing that I was able to find by searching was "Solution 4" at this link. While that comment was not easy to find, because it was very generic, and didn't turn up in searches for "formula", it did provide a debug technique which enabled me to compare the formula that was getting inserted initially, as in my question, with what was there after the editing "tweak". "CONCAT" has to be prefixed with "COM.MICROSOFT.". Not at all obvious to the first-time formula insertion attempt.
I'm very new to the whole programming thing but and ive ran into a pretty annoying problem.
This is a small slice of some code I had to do for school and I've ran into a problem where it keeps telling me the variables I'm trying to put into the {} brackets are not columns, when they shouldn't even be seen as columns in the first place. They are variables linked to some buttons and input things via Tkinter, I just want them to be placed into the columns.
cursor.execute("INSERT INTO reviews(name,messae,date,time,location,messaeg_id) VALUES ({},{},{},{},{},{})".format(naam, review, datumm, tijdd, locatie, review_id))
I've tried quite a few things like putting '' and ""s basically everywhere you could think of (I think), tried it with only one column and value, which just gave me a different error:
(psycopg2.errors.SyntaxError: syntax error at or near "VALUE")
If I kept it as VALUES instead of VALUE it gave me the same error as the main one this question is about.
Also "tried" some solutions I found on this site but since I'm still very new, I found it hard to adapt those solutions over to my code, hence why I've resorted to asking a question myself for once lol.
BTW it's pretty late here at the time of writing this and English is not my first language so please excuse any grammatical errors and what not lol
New to Python, and I find this bit rather confusing. I have a config file that is read into a kwarg. with values like:
students||student a|student b|student c
I see this populating properly into the kwarg when I debug, however, when I attempt to read the values, it will always only pull the first letter.
for student in kwargs.get('students'):
--student will come thru as 's'
this seems to be something specific to my machine, as this code is running in prod. I set my libraries the same as the server, but still having the issue. Anyone know why this might be occurring?
I am running on Python 3.6.5
Thanks
I know influx is for measurement type data. But I'm also using it for annotations on certain events.
I have scripts that run every minute, that it would be difficult for it to realise an event has already happened. Is there something I can do on the insert to only insert if a new record rather than every time.
So there didn't seem to be a way of doing it (and no answers here). But I solved the problem by performing a query first and if no record found perform an insert.
Basically i had to make the scripts figure it out.
While using django.core.paginator import ObjectPaginator, I'm getting this error:
NeedIndexError: The built-in indices
are not efficient enough for this
query and your data. Please add a
composite index for this query.
The original query is written in this form:
query = models.Cdr.all()
query.filter("var1 =", var1 )
query.filter("var2 =", var2)
query.filter("var3 =", var3)
I get this exception when ObjectPaginator tries to count the number of elements, but only for some values of var1.
Why would this query fail for some values of var1, while working with others?
What would you recommend for this case?
The general procedure recommended to fix NeedIndexError occurrences is this one. I expect the composite index may not have been built on your development depending on the amount and structure of the data (which can change depending on var1 value) but turns out to be needed (to avoid aborting the query for efficiency reasons, as the error msg hints and Nick confirms in this comment) when running on the actual store.
I have run into this problem. The problem is not with your code but with GAE's indexing system itself. To fix it, you have to explicitly write the index in your index.yaml file. That worked for me, but I have read elsewhere that explicitly defining your index may not always fix it. Regardless, I recommend that you star the bug I opened.
GAE does not automatically build an index for queries that only have equality filters. Instead, it uses an algorithm Google calls "zigzag merge join" (Google it). It appears that this algorithm is breaking down in certain situations. It looks like team google is working on fixing this problem, but it still pops up in some situations.