SMILA (incubation) API documentation

org.eclipse.smila.solr.search
Class SolrQueryBuilder

java.lang.Object
  extended by org.eclipse.smila.search.api.helper.QueryBuilder
      extended by org.eclipse.smila.solr.search.SolrQueryBuilder

public class SolrQueryBuilder
extends QueryBuilder

The SolrQueryBuilder class.

Author:
pwissel

Constructor Summary
SolrQueryBuilder()
          Default constructor.
SolrQueryBuilder(java.lang.String workflowName)
          Constructor.
SolrQueryBuilder(java.lang.String workflowName, DataFactory factory)
          Constructor.
SolrQueryBuilder(java.lang.String workflowName, Record request)
          Constructor.
 
Method Summary
 SolrQueryBuilder addFacetConfiguration(java.lang.String coreField, FacetQueryConfigAdapter config)
          Add a facet configuration for the given core field or set global/default parameters with SolrConstants.GLOBAL.
 SolrQueryBuilder addFields(java.lang.String... fields)
          Add fields parameter.
 SolrQueryBuilder addFilterQuery(java.lang.String filterQuery)
          Add a filter query.
 SolrQueryBuilder addHighlightingConfiguration(HighlightingQueryConfigAdapter config)
          Add a highlighting configuration.
 SolrResultAccessor executeRequest(SearchService searchService)
          execute query on given search service and wrap result in high level result helper.
 SolrQueryBuilder setQueryFindAll()
          Set the *:* as the query string to find all documents.
 SolrQueryBuilder setRequestHandler(java.lang.String name)
          Set the request handler.
 SolrQueryBuilder setRows(int rows)
          Set rows parameter.
 SolrQueryBuilder setShards(java.lang.String... shards)
          Set shards.
 SolrQueryBuilder setSpellCheckConfiguration(SpellCheckQueryConfigAdapter config)
          Set the spellcheck configuration.
 SolrQueryBuilder setStart(int start)
          Set start parameter.
 SolrQueryBuilder setTermsConfiguration(TermsQueryConfigAdapter config)
          Set the terms configuration.
 
Methods inherited from class org.eclipse.smila.search.api.helper.QueryBuilder
addAllOfFilter, addAtLeastFilter, addAtMostFilter, addAttributeConfig, addBoundFilter, addFilter, addGreaterThanFilter, addGroupByAttribute, addGroupByAttribute, addGroupByConfig, addHighlightAttributes, addLessThanFilter, addListFilter, addNoneOfFilter, addOneOfFilter, addParameter, addRangeFilter, addResultAttributes, addSortBy, executeRequestXml, executeRequestXmlString, getFactory, getMetadata, getQuery, getWorkflowName, setAttachment, setId, setIndexName, setLanguage, setMaxCount, setOffset, setParameter, setQuery, setQueryAttribute, setRanking, setResultAttributes, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SolrQueryBuilder

public SolrQueryBuilder()
Default constructor.


SolrQueryBuilder

public SolrQueryBuilder(java.lang.String workflowName)
Constructor.

Parameters:
workflowName - the workflow workflow name.

SolrQueryBuilder

public SolrQueryBuilder(java.lang.String workflowName,
                        DataFactory factory)
Constructor.

Parameters:
workflowName - the workflow name.
factory - the data factory.

SolrQueryBuilder

public SolrQueryBuilder(java.lang.String workflowName,
                        Record request)
Constructor.

Parameters:
workflowName - the workflow name.
request - the request record.
Method Detail

setStart

public SolrQueryBuilder setStart(int start)
Set start parameter.

Parameters:
start - the start parameter.
Returns:
the solr query builder.

setRows

public SolrQueryBuilder setRows(int rows)
Set rows parameter.

Parameters:
rows - the rows parameter.
Returns:
the solr query builder.

addFields

public SolrQueryBuilder addFields(java.lang.String... fields)
Add fields parameter.

Parameters:
fields - the fields parameter.
Returns:
the solr query record.

setRequestHandler

public SolrQueryBuilder setRequestHandler(java.lang.String name)
Set the request handler.

Parameters:
name - the name.
Returns:
the solr query builder.

addHighlightingConfiguration

public SolrQueryBuilder addHighlightingConfiguration(HighlightingQueryConfigAdapter config)
Add a highlighting configuration.

Parameters:
config - the highlighting configuration.
Returns:
the solr query record,

addFilterQuery

public SolrQueryBuilder addFilterQuery(java.lang.String filterQuery)
Add a filter query.

Parameters:
filterQuery - the filter query.
Returns:
the solr query builder.

addFacetConfiguration

public SolrQueryBuilder addFacetConfiguration(java.lang.String coreField,
                                              FacetQueryConfigAdapter config)
Add a facet configuration for the given core field or set global/default parameters with SolrConstants.GLOBAL. Note that u always must do one call with at least teh following to enable faceting at all.
 addFacetConfiguration(SolrConstants.FACET_GLOBAL_ATTR, new FacetQueryConfigAdapter(FacetType.SOLR))
 

Parameters:
coreField - the attribute name.
config - the facet configuration.
Returns:
the solr query builder.

setTermsConfiguration

public SolrQueryBuilder setTermsConfiguration(TermsQueryConfigAdapter config)
Set the terms configuration.

Parameters:
config - the terms configuration.
Returns:
the solr query builder.

executeRequest

public SolrResultAccessor executeRequest(SearchService searchService)
                                  throws ProcessingException
execute query on given search service and wrap result in high level result helper.

Overrides:
executeRequest in class QueryBuilder
Parameters:
searchService - search service instance.
Returns:
search result.
Throws:
ProcessingException - any error while processing the search
See Also:
QueryBuilder.executeRequest(org.eclipse.smila.search.api.SearchService)

setQueryFindAll

public SolrQueryBuilder setQueryFindAll()
Set the *:* as the query string to find all documents. Mainly used for testing. Only works when used with the right (default) query handler.

Returns:
SolrQueryBuilder.

setShards

public SolrQueryBuilder setShards(java.lang.String... shards)
Set shards.

Parameters:
shards - the shards.
Returns:
SolrQueryBuilder.

setSpellCheckConfiguration

public SolrQueryBuilder setSpellCheckConfiguration(SpellCheckQueryConfigAdapter config)
Set the spellcheck configuration.

Parameters:
config - the spellcheck configuraiton.
Returns:
SolrQueryBuilder.

SMILA (incubation) API documentation