11 #include <Poco/AutoPtr.h>
32 :
inherited(), fObj(fObj_), message(fObj.getCustomMessage())
41 std::string resultData;
42 timeval tvStart, tvStop;
43 gettimeofday(&tvStart, 0);
51 if (inputMessage.
getType() == SphinxInputJsonMessage::MessageType::mtIndex)
55 else if (inputMessage.
getType() == SphinxInputJsonMessage::MessageType::mtManage)
63 catch(Poco::Exception& e)
72 gettimeofday(&tvStop, 0);
77 outputMessage.
setData(resultData);
79 bool success = outputMessage.
serialize(resJson);
100 const std::string targetIndexName = (messageIndex.
getIndexName().empty())?fObj.getIndexName():messageIndex.
getIndexName();
106 fObject.setLogStream(fObj.log(LoggerStream::Priority::PRIO_INFORMATION));
117 if (!indexAppendDataFile.
execute())
123 if (!indexPackDocData.
execute())
161 if (!pCmd->unserialize(localJson))
162 throw Poco::Exception(pCmd->getErrorMsg(), pCmd->getErrorCode());
164 bool res = pCmd->execute();
165 resultData = pCmd->getResultData();
167 throw Poco::Exception(pCmd->getErrorMsg(), pCmd->getErrorCode());
177 std::string resultData;
178 timeval tvStart, tvStop;
179 gettimeofday(&tvStart, 0);
183 if (inputJsonMessage.
getType() == SphinxInputJsonMessage::MessageType::mtIndex)
187 else if (inputJsonMessage.
getType() == SphinxInputJsonMessage::MessageType::mtManage)
194 catch(Poco::Exception& e)
202 gettimeofday(&tvStop, 0);
207 outputMessage.
setData(resultData);
210 return outputMessage;