catalog: support autocompletion query

* use seaprate functions to for autocompletion query and component-based query
* add json-paramters as a name component in the query-results content
* set freshness for ACK data
* fix bug that catalog throws run-time error when malformed Json::value is used
* query-results data conforms the schema

Change-Id: I942c26888fa79c206f2fa27f6f0a92fc4a8bef79
refs: #3024, #2797, #3035, #3047
diff --git a/catalog/src/publish/publish-adapter.hpp b/catalog/src/publish/publish-adapter.hpp
index 492bcff..9fb03db 100644
--- a/catalog/src/publish/publish-adapter.hpp
+++ b/catalog/src/publish/publish-adapter.hpp
@@ -65,7 +65,8 @@
    */
   void
   setConfigFile(util::ConfigFile& config,
-                const ndn::Name& prefix);
+                const ndn::Name& prefix,
+                const std::vector<std::string>& nameFields);
 
 protected:
   /**
@@ -163,8 +164,10 @@
 template <typename DatabaseHandler>
 void
 PublishAdapter<DatabaseHandler>::setConfigFile(util::ConfigFile& config,
-                                               const ndn::Name& prefix)
+                                               const ndn::Name& prefix,
+                                               const std::vector<std::string>& nameFields)
 {
+  m_nameFields = nameFields;
   config.addSectionHandler("publishAdapter",
                            bind(&PublishAdapter<DatabaseHandler>::onConfig, this,
                                 _1, _2, _3, prefix));