1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

Full-text search: Tweak minor UI settings

This commit is contained in:
gnosygnu 2017-03-26 02:08:19 -04:00
parent dcdc69e374
commit 022cb2684e
7 changed files with 13 additions and 13 deletions

View File

@ -39,7 +39,7 @@ class Xofulltext_highlighter_mgr implements Gfo_invk {
this.searcher_data = searcher_data;
this.list = list;
}
private void Highlight_list() {
public void Highlight_list() {
// init highlighter
highlighter_mgr.Init(new Gflucene_index_data(analyzer_data, "")); // NOTE: index_dir not needed for highlighter

View File

@ -93,6 +93,6 @@ public class Xofulltext_searcher__lucene implements Xofulltext_searcher {
// create highlighter thread and launch it
Xofulltext_highlighter_mgr highlighter_mgr = new Xofulltext_highlighter_mgr(ui, wiki, args, analyzer_data, searcher_data, full_list);
gplx.core.threads.Thread_adp_.Start_by_key("highlighter", Cancelable_.Never, highlighter_mgr, Xofulltext_highlighter_mgr.Invk__highlight);
highlighter_mgr.Highlight_list(); // NOTE: do not launch in separate thread, else multiple wikis will have strange race conditions
}
}

View File

@ -15,16 +15,16 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
*/
package gplx.xowa.addons.wikis.fulltexts.searchers.mgrs.uis; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.fulltexts.*; import gplx.xowa.addons.wikis.fulltexts.searchers.*; import gplx.xowa.addons.wikis.fulltexts.searchers.mgrs.*;
public class Xofulltext_searcher_page {
public Xofulltext_searcher_page(int query_id, byte[] wiki_domain, int page_id, byte[] page_ttl, boolean expand_matches_section) {
public Xofulltext_searcher_page(int query_id, byte[] wiki_domain, int page_id, byte[] page_ttl, boolean expand_snips) {
this.query_id = query_id;
this.wiki_domain = wiki_domain;
this.page_id = page_id;
this.page_ttl = page_ttl;
this.expand_matches_section = expand_matches_section;
this.expand_snips = expand_snips;
}
public int Query_id() {return query_id;} private final int query_id;
public byte[] Wiki_domain() {return wiki_domain;} private final byte[] wiki_domain;
public int Page_id() {return page_id;} private final int page_id;
public byte[] Page_ttl() {return page_ttl;} private final byte[] page_ttl;
public boolean Expand_matches_section() {return expand_matches_section;} private final boolean expand_matches_section;
public boolean Expand_snips() {return expand_snips;} private final boolean expand_snips;
}

View File

@ -46,7 +46,7 @@ public class Xofulltext_searcher_ui {
.Add_bry("wiki", page.Wiki_domain())
.Add_int("page_id", page.Page_id())
.Add_bry("page_ttl", page.Page_ttl())
.Add_bool("expand_matches_section", page.Expand_matches_section())
.Add_bool("expand_snips", page.Expand_snips())
);
cache_mgr.Add_page(page.Query_id(), page.Wiki_domain(), page.Page_id(), page.Page_ttl());
}

View File

@ -76,7 +76,7 @@ class Xofulltext_searcher_html extends Xow_special_wtr__base implements Mustache
head_tags.Add(Xopg_tag_itm.New_js_file(addon_dir.GenSubFil_nest("bin", "xofulltext_searcher.js")));
head_tags.Add(Xopg_tag_itm.New_htm_frag(addon_dir.GenSubFil_nest("bin", "xofulltext_searcher.wiki.template.html"), "xofts.wiki"));
head_tags.Add(Xopg_tag_itm.New_htm_frag(addon_dir.GenSubFil_nest("bin", "xofulltext_searcher.page.template.html"), "xofts.page"));
head_tags.Add(Xopg_tag_itm.New_htm_frag(addon_dir.GenSubFil_nest("bin", "xofulltext_searcher.line.template.html"), "xofts.line"));
head_tags.Add(Xopg_tag_itm.New_htm_frag(addon_dir.GenSubFil_nest("bin", "xofulltext_searcher.snip.template.html"), "xofts.snip"));
page_data.Js_enabled_y_();
}

View File

@ -28,18 +28,18 @@ public class Xofulltext_searcher_bridge implements Bridge_cmd_itm {
case Proc__search_run: svc.Search_run(args); break;
case Proc__search_cxl: svc.Search_cxl(args); break;
case Proc__options_save: svc.Options_save(args); break;
case Proc__get_lines_rest: svc.Get_lines_rest(args); break;
case Proc__snips_show_all: svc.Snips_show_all(args); break;
default: throw Err_.new_unhandled_default(proc_id);
}
return "";
}
private static final byte Proc__search_run = 0, Proc__search_cxl = 1, Proc__options_save = 2, Proc__get_lines_rest = 3;
private static final byte Proc__search_run = 0, Proc__search_cxl = 1, Proc__options_save = 2, Proc__snips_show_all = 3;
private static final Hash_adp_bry proc_hash = Hash_adp_bry.cs()
.Add_str_byte("search_run" , Proc__search_run)
.Add_str_byte("search_cxl" , Proc__search_cxl)
.Add_str_byte("options_save" , Proc__options_save)
.Add_str_byte("get_lines_rest" , Proc__get_lines_rest)
.Add_str_byte("snips_show_all" , Proc__snips_show_all)
;
public byte[] Key() {return BRIDGE_KEY;} public static final byte[] BRIDGE_KEY = Bry_.new_a7("xowa.wiki.fulltext.searcher");

View File

@ -150,10 +150,10 @@ class Xofulltext_searcher_svc implements Gfo_invk {
return true;
}
public void Get_lines_rest(Json_nde args) {
Get_lines_rest(args.Get_as_int("qry_id"), args.Get_as_bry("wiki"), args.Get_as_int("page_id"), args.Get_as_str("page_guid"));
public void Snips_show_all(Json_nde args) {
Snips_show_all(args.Get_as_int("qry_id"), args.Get_as_bry("wiki"), args.Get_as_int("page_id"), args.Get_as_str("page_guid"));
}
private void Get_lines_rest(int qry_id, byte[] wiki_bry, int page_id, String page_guid) {
private void Snips_show_all(int qry_id, byte[] wiki_bry, int page_id, String page_guid) {
Xofulltext_cache_mgr cache_mgr = this.Cache_mgr();
Xofulltext_searcher_ui searcher_ui = new Xofulltext_searcher_ui(cache_mgr, app.Gui__cbk_mgr(), new Xog_cbk_trg(page_guid));