gapi.cloudsearch.widget.searchbox.Builder
검색창 빌더입니다. 빌더를 사용하고 searchbox 생성자를 직접 호출하지 마세요.
생성자
Builder
new Builder()
예
// Builds a search box.
function onload() {
  gapi.client.init({
    'apiKey': '<your api key>',
    'clientId': '<your client id>',
    // Add additional scopes if needed
    'scope': 'https://www.googleapis.com/auth/cloud_search.query',
    'hosted_domain': '<your G Suite domain>',
  });
  const searchBox = new gapi.cloudsearch.widget.searchbox.Builder()
    .setInput(document.getElementById('input'))
    .setAnchor(document.getElementById('input').parentElement)
    .build();
}
gapi.load('client:cloudsearch-widget', onload);메서드
빌드
build()가 SearchBox를 반환합니다.
- 반환 값
 - 
                  
non-null SearchBox 
setAdapter
setAdapter(adapter)가 Builder를 반환합니다.
필수사항: 이 어댑터를 사용하여 사용자의 검색 환경을 맞춤설정합니다.
                      매개변수 | 
                  |
|---|---|
| 
                         adapter  | 
                      
                        
                         메서드의 일부를 재정의할 수 있습니다. 값은 null이 아니어야 합니다.  | 
                    
- 반환 값
 - 
                  
non-null Builderthis 
예
const adapter = {
 interceptSuggestRequest: function(request) {
    // Change the request
  }
}
builder.setAdapter(adapter).build();setAnchor
setAnchor(anchor)가 빌더를 반환합니다.
필수사항: 하위 노드를 포함할 수 있는 유효한 HTMLElement이어야 합니다. 검색 오버레이의 앵커입니다. 오버레이가 앵커의 마지막 하위 요소로 추가됩니다. 오버레이의 위치는 앵커의 하단입니다.
                      매개변수 | 
                  |
|---|---|
| 
                         앵커  | 
                      
                         HTMLElement 값은 null이 아니어야 합니다.  | 
                    
- 지원 중단됨
 - 대신 `setAnchorElement` 사용
 - 반환 값
 - 
                  
non-null Builderthis 
setAnchorElement
setAnchorElement(anchorElement)가 Builder를 반환합니다.
필수사항: 하위 노드를 포함할 수 있는 유효한 HTMLElement이어야 합니다. 검색 오버레이의 앵커입니다. 오버레이가 앵커의 마지막 하위 요소로 추가됩니다. 오버레이의 위치는 앵커의 하단입니다.
                      매개변수 | 
                  |
|---|---|
| 
                         anchorElement  | 
                      
                         HTMLElement 값은 null이 아니어야 합니다.  | 
                    
- 반환 값
 - 
                  
non-null Builderthis 
setHints
setHints(hints)가 Builder를 반환합니다.
선택사항. 입력이 비어 있을 때 검색창에 표시되는 힌트입니다. 입력이 비어 있으면 배열에서 무작위 힌트가 선택됩니다.
                      매개변수 | 
                  |
|---|---|
| 
                         힌트  | 
                      
                         문자열 배열 값은 null이 아니어야 합니다.  | 
                    
- 반환 값
 - 
                  
non-null Builderthis 
setInput
setInput(input)이 Builder를 반환합니다.
필수사항: 사용자가 쿼리를 입력하는 HTMLElement입니다. <input> 또는 <textarea>여야 합니다.
                      매개변수 | 
                  |
|---|---|
| 
                         입력  | 
                      
                         HTMLElement 값은 null이 아니어야 합니다.  | 
                    
- 지원 중단됨
 - 대신 `setInputElement` 사용
 - 반환 값
 - 
                  
non-null Builderthis 
setInputElement
setInputElement(inputElement)이 Builder를 반환합니다.
필수사항: 사용자가 쿼리를 입력하는 HTMLElement입니다. <input> 또는 <textarea>여야 합니다.
                      매개변수 | 
                  |
|---|---|
| 
                         inputElement  | 
                      
                         HTMLElement 값은 null이 아니어야 합니다.  | 
                    
- 반환 값
 - 
                  
non-null Builderthis 
setResultsContainer
setResultsContainer(resultsContainer)가 빌더를 반환합니다.
선택사항. 검색 결과를 표시하는 컨테이너입니다. 이 속성을 설정하면 검색 결과가 검색 결과 컨테이너에 렌더링됩니다. 설정하지 않으면 결과가 cloudsearch.google.com에 표시됩니다.
                      매개변수 | 
                  |
|---|---|
| 
                         resultsContainer  | 
                      
                         gapi.cloudsearch.widget.resultscontainer.ResultsContainer 값은 null이 아니어야 합니다.  | 
                    
- 참고 항목
 - ResultsContainer
 - 반환 값
 - 
                  
non-null Builderthis 
setSearchApplicationId
setSearchApplicationId(searchApplicationId)가 Builder를 반환합니다.
선택사항. 요청에 사용할 검색 애플리케이션 ID를 설정합니다. 'searchapplications/' 접두사가 있어야 합니다.
                      매개변수 | 
                  |
|---|---|
| 
                         searchApplicationId  | 
                      
                         문자열  | 
                    
- 반환 값
 - 
                  
non-null Builderthis 
setThrottleInterval
setThrottleInterval(throttleInterval)이 Builder를 반환합니다.
선택사항. 요청 실행 시 제한 간격(밀리초)입니다. 검색창이 throttleInterval 밀리초마다 요청을 1개 미만으로 전송합니다. throttleInternal이 200보다 작으면 검색창에서 이 값을 무시하고 대신 200을 간격으로 사용합니다.
                      매개변수 | 
                  |
|---|---|
| 
                         throttleInterval  | 
                      
                         숫자  | 
                    
- 반환 값
 - 
                  
non-null Builderthis