J
J
Julia Kovalenko2018-03-07 11:22:53
Sphinx
Julia Kovalenko, 2018-03-07 11:22:53

Sphinx breaks, invalid xml?

Hello!
There is a base in mongoDB. With the help of javascript, I collect xml, which I feed to sphinx (Sphinx 2.2.10-id64-release (2c212e0)) so that it indexes the data in the mong. The whole process was debugged and everything worked like clockwork. But all of a sudden, for no reason at all, such errors began to appear:

ERROR: index 'my_data_index': source 'my_data': XML parse error: no element found (line=1488774, pos=0, docid=24557554).

I look at xml at line 1488774:
$ mongo my_db --quiet parse_index.js | grep -n '' | egrep '^1488774' -A8 -B9        
1488765:<sphinx:document id="24557554"> 
1488766:    <last_name>Иванова</last_name> 
1488767:    <first_name>Мария</first_name> 
1488768:    <middle_name>Владимировна</middle_name> 
1488769:    <bdate>41</bdate> 
1488770:    <bmonth>1</bmonth> 
1488771:    <byear>1975</byear> 
1488772:    <city>Санкт-Петербург</city> 
1488773:</sphinx:document> 
1488774:<sphinx:document id="24557584"> 
1488775:    <last_name>Петров</last_name> 
1488776:    <first_name>Дмитрий</first_name> 
1488777:    <middle_name>Иванович</middle_name> 
1488778:    <bdate>14</bdate> 
1488779:    <bmonth>9</bmonth> 
1488780:    <byear>1993</byear> 
1488781:    <city>Москва</city> 
1488782:</sphinx:document>

Everything worked before. Nothing has changed, no updates have been made. We just launched indexer and everything started to break.
Any ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
abroabr, 2018-03-22
@abroabr

Everything worked before. Nothing has changed, no updates have been made. We just launched indexer and everything started to break.
Any ideas?

Faced. Diagnosing this problem with Sphinx is laconic, unfortunately.
Take a look at the XML standard.
Well, or do not write directly to XML as a text file, but write to XML through a specialized library that can work correctly with XML.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question