📄 searchclienttest.java
字号:
package com.yahoo.search;import java.io.IOException;public class SearchClientTest { private static final String SHORT_CONTENT = "This is some really short content"; private static final String LONG_CONTENT = "This is some really long content that " + "ought to force the RestClient to switch from GET to POST. That way I can " + "test to make sure it's doing that automagically like it ought to be. If " + "it's not doing what I want it to do, then I need to fix the bug. It would " + "be bad to let that get out to the users. They would probably have my head " + "if I screwed with them like that. So I'll just test it now and make sure it " + "works so there's no issues with them claiming my head. I think this is more " + "than 255 characters, so I'll stop typing right now."; public static void main(String[] args) throws IOException, SearchException { SearchClient client = new SearchClient("javasdktest"); ContextSearchRequest request = new ContextSearchRequest(SHORT_CONTENT); WebSearchResults results = client.contextWebSearch(request); System.out.println("results.getTotalResultsAvailable() = " + results.getTotalResultsAvailable()); request = new ContextSearchRequest(LONG_CONTENT); results = client.contextWebSearch(request); System.out.println("results.getTotalResultsAvailable() = " + results.getTotalResultsAvailable()); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -