Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.factual.driver;
 
 import java.util.Map;

The Boost API enables you to signal to Factual that a specific row returned by full-text search in a read API call should be a prominent result for that search.

Author(s):
brandon
public class Boost {

  

Parameters:
factualId
  public Boost(String factualId) {
    addParam(.factualId);
  }

  

Parameters:
factualId
query initialize boost from an existing read query.
  public Boost(String factualIdQuery query) {
    this(factualId);
    String queryUser = query.user();
    if (queryUser != null)
      user(queryUser);
    String querySearch = query.search();
    if (querySearch != null)
      search(querySearch);
  }

  
Holds all parameters for this Boost.
  protected final Parameters queryParams = new Parameters();

  
Full-text-search query parameter value for q from a prior read request.

Parameters:
term
Returns:
this Boost
  public Boost search(String term) {
    addParam(.term);
    return this;
  }

  

Parameters:
user An (optional) arbitrary token for correlating boost requests to a single app/session/etc. Factual does not use this token to track users. The function of this information is only to help evaluate how a boost relates to a search.
Returns:
this Boost
  public Boost user(String user) {
    addParam(.user);
    return this;
  }
  private Boost addParam(String keyObject value) {
    .setParam(keyvalue);
    return this;
  }
  protected Map<StringObjecttoUrlParams() {
    return .toUrlParams(null);
  }
  public String toString() {
    try {
      return URLDecoder.decode(UrlUtil.toUrlQuery(toUrlParams()), "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }
New to GrepCode? Check out our FAQ X