2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 // $XConsortium: DtSR_SearchEngine.hh /main/5 1996/05/29 12:31:30 rcs $
24 /* Copyright (c) 1995,1996 FUJITSU LIMITED */
25 /* All Rights Reserved */
27 #ifndef _DTSR_SEARCHENGINE_HH_
28 #define _DTSR_SEARCHENGINE_HH_
30 #include "UAS_Pointer.hh"
31 #include "UAS_SearchEngine.hh"
37 #include "DtSR_Parser.hh"
38 #include "DtSR_SearchResults.hh"
39 #include "DtSR_SearchResultsEntry.hh"
41 class DtSR_SearchEngine : public UAS_SearchEngine
44 static DtSR_SearchEngine &search_engine
45 (UAS_PtrList<const char> *bcases = NULL);
47 UAS_Pointer<UAS_SearchResults> search (UAS_String query,
48 UAS_SearchScope & scope,
49 unsigned int maxdocs);
53 UAS_Pointer<UAS_String> db_name(int n);
54 char *char_db_name(int n);
55 int db_count() { return f_dbcount; }
59 void init(UAS_PtrList<const char> *bcases);
61 // NOTE: compress_DtSrResult frees res space
62 UAS_Pointer<UAS_List<UAS_SearchResultsEntry> >
63 compress_DtSrResult(DtSrResult*&, long &);
66 // enforce as a singleton class
67 static DtSR_SearchEngine *f_search_engine;
69 UAS_String f_config_path;
74 unsigned int f_valid_bc_map;
76 static int f_init_count;
79 // The DtSR_SE is responsible for translating the query from OQL
80 // into the query structure required by the DtSearch engine and does the
81 // actual search. It then calls the DtSearchResult constructor with the
82 // cookies required to retrieve results.