Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.factual.driver;
  
  import java.util.List;
  
Represents a top level Factual facet query. Knows how to represent the facet query as URL encoded key value pairs, ready for the query string in a GET request. (See toUrlQuery())

Author(s):
brandon
 
 public class FacetQuery implements Filterable {
 
 	private boolean includeRowCount;

Constructor.

Parameters:
fields fields for which facets will be generated
 
 	public FacetQuery(String... fields) {
 		select(fields);
 	}

Holds all parameters for this FacetQuery.
 
 	private final Parameters queryParams = new Parameters();
 
 	public String toUrlQuery() {
 		Parameters additional = null;
 		if () {
 			additional = new Parameters();
 			additional.setParam(.,true);
 		}
 		return .toUrlQuery(additionaltrue);
 	}

Set a parameter and value pair for specifying url parameters, specifically those not yet available as convenience methods.

Parameters:
key the field name of the parameter to add
value the field value that will be serialized using value.toString()
Returns:
this FacetQuery
 
 	private FacetQuery addParam(String keyObject value) {
 		.setParam(keyvalue);
 		return this;
 	}

For each facet value count, the minimum number of results it must have in order to be returned in the response. Must be zero or greater. The default is 1.

Parameters:
minCount for each facet value count, the minimum number of results it must have in order to be returned in the response. Must be zero or greater. The default is 1.
Returns:
this FacetQuery
 
 	public FacetQuery minCountPerFacetValue(long minCount) {
 		return this;
 	}

The maximum number of unique facet values that can be returned for a single field. Range is 1-250. The default is 25.

Parameters:
maxValuesPerFacet the maximum number of unique facet values that can be returned for a single field. Range is 1-250. The default is 25.
Returns:
this FacetQuery
 
 	public FacetQuery maxValuesPerFacet(long maxValuesPerFacet) {
 		return this;
 	}

The fields for which facets should be generated. The response will not be ordered identically to this list, nor will it reflect any nested relationships between fields.

Parameters:
fields the fields for which facets should be generated. The response will not be ordered identically to this list, nor will it reflect any nested relationships between fields.
Returns:
this FacetQuery
 
 	private FacetQuery select(String... fields) {
 		for (String field : fields) {
 		}
 		return this;
 	}

    
Sets a full text search query. Factual will use this value to perform a full text search against various attributes of the underlying table, such as entity name, address, etc.

Parameters:
term the text for which to perform a full text search.
Returns:
this FacetQuery
 
 	public FacetQuery search(String term) {
 		return this;
 	}

Begins construction of a new row filter for this FacetQuery.

Parameters:
field the name of the field on which to filter.
Returns:
A partial representation of the new row filter.
	public QueryBuilder<FacetQueryfield(String field) {
		return new QueryBuilder<FacetQuery>(thisfield);
	}
	public FacetQuery near(String textint meters) {
		Coord coord = new DataScienceToolkit().streetToCoord(text);
		if (coord != null) {
			return within(new Circle(coordmeters));
else {
					"Could not locate place based on text: '" + text + "'");
		}
	}

Adds a filter so that results can only be (roughly) within the specified geographic circle.

Parameters:
circle The circle within which to bound the results.
Returns:
this FacetQuery.
	public FacetQuery within(Circle circle) {
		return this;
	}

Used to nest AND'ed predicates.
	public FacetQuery and(FacetQuery... queries) {
		return this;
	}

Used to nest OR'ed predicates.
	public FacetQuery or(FacetQuery... queries) {
		return this;
	}

Adds filter to this FacetQuery.
	public void add(Filter filter) {
	}

The response will include a count of the total number of rows in the table that conform to the request based on included filters. This will increase the time required to return a response. The default behavior is to NOT include a row count.

Returns:
this FacetQuery, marked to return total row count when run.
		return includeRowCount(true);
	}

When true, the response will include a count of the total number of rows in the table that conform to the request based on included filters. Requesting the row count will increase the time required to return a response. The default behavior is to NOT include a row count.

Parameters:
includeRowCount true if you want the results to include a count of the total number of rows in the table that conform to the request based on included filters.
Returns:
this FacetQuery.
	public FacetQuery includeRowCount(boolean includeRowCount) {
		this. = includeRowCount;
		return this;
	}
	public List<FiltergetFilterList() {
	}
New to GrepCode? Check out our FAQ X