1

My code is:

import pyes

conn = pyes.ES(myes_path)

siplist =['a','b','c']
diplist = ['d','e','f']

bf = pyes.filters.BoolFilter()
bf.add_must(pyes.filters.TermsFilter('sip',siplist))
bf.add_must(pyes.filters.TermsFilter('dip',diplist))

fq = pyes.query.FilteredQuery(pyes.query.MatchAllQuery(),bf)
res = conn.search(fq,'hhhhh')
print res.total

I always get this error:

bits = error.split('[', 1) TypeError: 'NoneType' object is not callable

Does anyone know what is the problem?

Ryan Bemrose
  • 9,018
  • 1
  • 41
  • 54
lin
  • 53
  • 3
  • bits = error.split where is this line – Rahul Jun 20 '16 at 05:39
  • Can you post a reproducible example (I don't know what the myes_path is meant to represent? Is this a data file?), and maybe the stack trace for the Python error. Sounds like your error is in one of the values you're passing to pyes. – Andrew Guy Jun 20 '16 at 05:42
  • hi Rahul and Andrew, thanks for replying. I tried my code on other dataset just new and it worked, but when I made the diplist a long list, I mean the len(diplist) is a big value, say 160000, it shows ' error.split('[', 1) TypeError: 'NoneType' object is not callable' again. Is this because the length of diplist exceeds maximum value set by pyes? – lin Jun 20 '16 at 08:25
  • And, when I do the search, can I do something like res = conn.search(fq, ['hhhhh','gggg']) where ['hhhhh','gggg'] means indices list, is this valid in pyes? – lin Jun 20 '16 at 08:37
  • You should add the complete traceback [mcve] – Håken Lid Jun 20 '16 at 08:50
  • I had this error when making records from keys that contained punctuation. Removing the punctuation fixed the issue. – RHC Jul 14 '16 at 23:48

0 Answers0