【发布时间】:2015-10-12 05:52:15
【问题描述】:
我想使用 GSAClient 访问我们公司的 google Search Appliance 项目并检索搜索结果,但我的配置根本不工作。
网页界面是:http://kb.juniper.net
那么为了让 GSAClientDemo 工作,我应该如何设置:
- 主机名
- SETTING_FRONTEND
我必须向 GSA 管理员询问设置吗?
// target GSA's hostname
private static final String HOSTNAME = "kb.juniper.net";
// query string to search for
private static final String QUERY_STRING = "juno";
// The value for the frontend configured for the GSA
// (If you dont know this, ask GSA admin for correct value for your target GSA.)
private static final String SETTING_FRONTEND = "InfoCenter";
public static void main(String[] args) throws IOException {
GSAClient client = new GSAClient(HOSTNAME);
GSAQuery query = new GSAQuery();
// typical way to generate query term.
GSAQueryTerm term = new GSAQueryTerm(QUERY_STRING);
query.setQueryTerm(term);
System.out.println("Searching for: "+query.getQueryString());
【问题讨论】: