00001 #ifndef LUX_API_SEARCHER_H 00002 #define LUX_API_SEARCHER_H 00003 00004 #include "lux/lux.h" 00005 #include "result.h" 00006 #include "engine.h" 00007 #include "lux/index/index_result.h" 00008 #include <string> 00009 00010 namespace Lux { 00011 00012 class Condition; 00013 class DocumentDefinition; 00014 00018 class Searcher { 00019 00020 public: 00025 Searcher(Engine &engine); 00029 ~Searcher(); 00034 void set_sys_cond(sys_cond_t sys_cond); 00040 ResultSet search(const char *query, Condition &cond); 00046 ResultSet search(const std::string &query, Condition &cond); 00051 IndexResultSet search_by_server(const char *query, Condition &cond); 00056 IndexResultSet search_by_server(const std::string &query, Condition &cond); 00061 std::string getdoc_by_server(doc_id_t doc_id); 00065 void clear_attrs(IndexResultSet &irs, Condition &cond); 00066 00067 private: 00068 Engine engine_; 00069 00070 IndexResultSet search_index(const std::string &query); 00071 void set_attrs(IndexResultSet &irs, Condition &cond); 00072 }; 00073 } 00074 00075 #endif