diff --git a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/brutes/finders/Xofulltext_finder_cbk__highlight.java b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/brutes/finders/Xofulltext_finder_cbk__highlight.java index aead9f489..1f9acdb60 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/brutes/finders/Xofulltext_finder_cbk__highlight.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/brutes/finders/Xofulltext_finder_cbk__highlight.java @@ -62,7 +62,7 @@ public class Xofulltext_finder_cbk__highlight implements Xofulltext_finder_cbk { // send notification byte[] line_html = tmp_bfr.To_bry_and_clear(); - ui.Send_line_add(show_all_matches, qry_id, wiki.Domain_bry(), page_id, found, line_html); + ui.Send_line_add(true, show_all_matches, qry_id, wiki.Domain_bry(), page_id, found, line_html); found++; } private static final byte[] Angle_bgn_escaped = Bry_.new_a7("<"); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/gflucenes/Xofulltext_highlighter_mgr.java b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/gflucenes/Xofulltext_highlighter_mgr.java index 1c9a6e68a..99f59be04 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/gflucenes/Xofulltext_highlighter_mgr.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/gflucenes/Xofulltext_highlighter_mgr.java @@ -74,7 +74,7 @@ class Xofulltext_highlighter_mgr implements Gfo_invk { int page_id = item.page_id; Gflucene_highlighter_item[] lines = highlighter_mgr.Exec(searcher_data, item); for (Gflucene_highlighter_item line : lines) { - ui.Send_line_add(searcher_args.show_all_matches, searcher_args.qry_id, wiki.Domain_bry(), page_id, line.num, Bry_.new_u8(line.text)); + ui.Send_line_add(true, searcher_args.show_all_matches, searcher_args.qry_id, wiki.Domain_bry(), page_id, line.num, Bry_.new_u8(line.text)); } } public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { diff --git a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/gflucenes/Xofulltext_searcher__lucene.java b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/gflucenes/Xofulltext_searcher__lucene.java index 34716aa40..8dc9cf454 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/gflucenes/Xofulltext_searcher__lucene.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/gflucenes/Xofulltext_searcher__lucene.java @@ -47,9 +47,13 @@ public class Xofulltext_searcher__lucene implements Xofulltext_searcher { int needed_end = wiki_args.bgn + wiki_args.len; int needed_len = needed_end - needed_bgn; int found = 0; + int threshold = 0; Gflucene_searcher_qry searcher_data = new Gflucene_searcher_qry(String_.new_u8(args.search_text), 100); while (found < needed_len) { if (args.Canceled()) return; + + threshold += wiki_args.len; + searcher_data.match_max = threshold; searcher.Exec(temp_list, searcher_data); int temp_list_len = temp_list.Len(); diff --git a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/uis/Xofulltext_searcher_ui.java b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/uis/Xofulltext_searcher_ui.java index a5e9bf2ed..e04e55005 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/uis/Xofulltext_searcher_ui.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/mgrs/uis/Xofulltext_searcher_ui.java @@ -50,8 +50,9 @@ public class Xofulltext_searcher_ui { ); cache_mgr.Add_page(page.Query_id(), page.Wiki_domain(), page.Page_id(), page.Page_ttl()); } - public void Send_line_add(boolean show_all_matches, int qry_id, byte[] wiki_domain, int page_id, int line_sort_order, byte[] line_html) { - cache_mgr.Add_line(qry_id, wiki_domain, page_id, line_sort_order, line_html); + public void Send_line_add(boolean add_to_cache, boolean show_all_matches, int qry_id, byte[] wiki_domain, int page_id, int line_sort_order, byte[] line_html) { + if (add_to_cache) + cache_mgr.Add_line(qry_id, wiki_domain, page_id, line_sort_order, line_html); line_sort_order += List_adp_.Base1; // NOTE: increment after cache_mgr if (line_sort_order == 1 || show_all_matches) { diff --git a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/svcs/Xofulltext_searcher_svc.java b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/svcs/Xofulltext_searcher_svc.java index f01992e40..6264fff73 100644 --- a/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/svcs/Xofulltext_searcher_svc.java +++ b/400_xowa/src/gplx/xowa/addons/wikis/fulltexts/searchers/svcs/Xofulltext_searcher_svc.java @@ -129,7 +129,7 @@ class Xofulltext_searcher_svc implements Gfo_invk { int lines_len = page.Lines().Len(); for (int j = 0; j < lines_len; j++) { Xofulltext_cache_line line = (Xofulltext_cache_line)page.Lines().Get_at(j); - ui.Send_line_add(args.show_all_matches, qry_id, wiki.Domain_bry(), page.Page_id(), line.Line_seq(), line.Line_html()); + ui.Send_line_add(false, args.show_all_matches, qry_id, wiki.Domain_bry(), page.Page_id(), line.Line_seq(), line.Line_html()); } } return true; @@ -144,7 +144,7 @@ class Xofulltext_searcher_svc implements Gfo_invk { Xofulltext_cache_line[] lines = cache_mgr.Get_lines_rest(qry_id, wiki_bry, page_id); for (Xofulltext_cache_line line : lines) { - searcher_ui.Send_line_add(true, qry_id, wiki_bry, page_id, line.Line_seq(), line.Line_html()); + searcher_ui.Send_line_add(false, true, qry_id, wiki_bry, page_id, line.Line_seq(), line.Line_html()); } } private Xofulltext_searcher Get_searcher(Xow_wiki wiki) {