2 * This file is part of NeverNote
\r
3 * Copyright 2009 Randy Baumgarte
\r
5 * This file may be licensed under the terms of of the
\r
6 * GNU General Public License Version 2 (the ``GPL'').
\r
8 * Software distributed under the License is distributed
\r
9 * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
\r
10 * express or implied. See the GPL for the specific language
\r
11 * governing rights and limitations.
\r
13 * You should have received a copy of the GPL along with this
\r
14 * program. If not, go to http://www.gnu.org/licenses/gpl.html
\r
15 * or write to the Free Software Foundation, Inc.,
\r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
21 package cx.fbn.nevernote.filters;
\r
23 import java.util.ArrayList;
\r
24 import java.util.List;
\r
26 import com.evernote.edam.type.Note;
\r
27 import com.evernote.edam.type.Tag;
\r
29 import cx.fbn.nevernote.Global;
\r
30 import cx.fbn.nevernote.sql.requests.EnSearchRequest;
\r
32 public class EnSearch {
\r
35 private List<Note> matches;
\r
36 public List<String> hilightWords;
\r
39 public EnSearch(int i, String s, List<Tag> t, int len, int weight) {
\r
43 if (s.trim().equals(""))
\r
47 EnSearchRequest request = new EnSearchRequest();
\r
48 request.requestor_id = id;
\r
49 // request.type = DeletedItemRequest.Get_All;
\r
50 request.string1 = s;
\r
52 request.tags = new ArrayList<Tag>();
\r
53 for (int k=0; k<t.size(); k++) {
\r
54 request.tags.add(t.get(k).deepCopy());
\r
58 request.int2 = weight;
\r
59 Global.dbRunner.addWork(request);
\r
60 Global.dbClientWait(id);
\r
61 EnSearchRequest req = Global.dbRunner.enSearchResponse.get(id);
\r
62 hilightWords = req.responseStrings;
\r
63 matches = req.responseNotes;
\r
66 public List<Note> matchWords() {
\r