com.endeca.navigation
Class ENEQuery

java.lang.Object
  extended by com.endeca.navigation.ENEQuery
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
UrlENEQuery

public class ENEQuery
extends Object
implements Serializable

An object used for expressing queries to an Endeca MDEX Engine. An ENEQuery object is used with a query method (of HttpENEConnection or AuthHttpENEConnection) to query the MDEX Engine, which then returns an ENEQueryResults object.

An ENEQuery object can contain one of each of the following types of queries: a record query, a navigation query, an aggregated record query, a dimension search query, and/or a navigation search.

All setter and getter methods are named according to the type of query they affect. The "contains" methods give quick access to determine what type of results the ENEQuery object will yield.

While there are many query options, only a few critical ENEQuery methods are necessary to make basic queries:

See Also:
Serialized Form

Field Summary
static int ALL_ERECS_PER_AGGR
          All records that compose a aggregated record will be returned.
static int DIM_SEARCH_ALL_DIM_VALUES
          All matches from dimension search will be returned from each dimension.
static String KEY_PROPS_ALL
          Request all key properties be returned.
static String KEY_PROPS_NONE
          Request no key properties be returned.
static int MAX_BULK_ERECS_AVAILABLE
          All the records that are associated with the current navigation state should be returned through the bulk record iterator.
static int NAV_SORT_ASCENDING
          Sort the navigation query's matching records in ascending order.
static int NAV_SORT_DESCENDING
          Sort the navigation query's matching records in descending order.
static int ONE_EREC_PER_AGGR
          One of the records that compose a aggregated record will be returned.
static int ZERO_ERECS_PER_AGGR
          None of the records that compose a aggregated record will be returned.
 
Constructor Summary
ENEQuery()
          Zero argument default constructor.
 
Method Summary
 boolean containsAggrERecQuery()
          Returns if this query includes a aggregated record query.
 boolean containsDimSearchQuery()
          Returns if this query includes a dimension search query.
 boolean containsERecQuery()
          Returns if this query includes a record query.
 boolean containsERecsQuery()
          Returns if this query includes a query for records.
 boolean containsNavQuery()
          Returns whether the query includes a navigation query.
 boolean containsQuery()
          Returns whether the query is querying for any of a navigation, record, dimension search, or a value set search.
 long getAggrERec()
          Deprecated. This method may not be supported in future versions of the MDEX Engine API - use getAggrERecSpec() instead. Gets the ID of the aggregated record to be queried for.
 ERecSortKeyList getAggrERecActiveSortKeys()
          Get the list of sort keys with which the aggregated records representative records will be sorted.
 DimValIdList getAggrERecNavDescriptors()
          Gets the navigation values which the aggregated record will be composed in relation to.
 RangeFilterList getAggrERecNavRangeFilters()
          Gets the navigation range filters which the aggregated record will be composed in relation to.
 String getAggrERecNavRecordFilter()
          Gets the record filter which the aggregated record will be composed in relation to.
 String getAggrERecRollupKey()
          Gets the rollup key the aggregated record is composed by.
 String getAggrERecSpec()
          Gets the specification of the aggregated record to be queried for.
 String getAggrERecStructureExpr()
          Gets the structure expression used to filter members of the aggregated record.
 AnalyticsQuery getAnalyticsQuery()
          Gets the AnalyticsQuery instance (if any) at the root of the AST that represents the Latitude Analytics query string.
 boolean getDimSearchCompound()
          Gets whether that dimension search will include compound results.
 long getDimSearchDimension()
          If calling getDimSearchDimensions() would return a list with a single value, that value will be returned by this function.
 DimValIdList getDimSearchDimensions()
          Gets the dimensions from which the dimension search can search from.
 DimValIdList getDimSearchNavDescriptors()
          Gets the navigation values that restrict the dimension search.
 RangeFilterList getDimSearchNavRangeFilters()
          Gets the navigation range filters that restrict the dimension search.
 String getDimSearchNavRecordFilter()
          Gets the record filter for the current dimension search.
 String getDimSearchNavRecordStructureExpr()
          Gets the structure expression for this dimension search.
 int getDimSearchNumDimValues()
          Gets the number of values returned from each dimension for value search.
 String getDimSearchOpts()
          Gets the search options that dimension search will use.
 boolean getDimSearchRankResults()
          Gets how the dimension search results will be sorted.
 long getDimSearchResultsOffset()
          Gets the offset with which the dimension search will return values per dimension.
 String getDimSearchTerms()
          Gets the search terms the dimension search will use.
 ERecIdList getERecs()
          Gets the IDs of the records being queried for.
 String getLanguageId()
          Gets the ISO639 language ID to be used for this query.
 ERecSortKeyList getNavActiveSortKeys()
          Get the list of sort keys with which the navigation query's records will be sorted.
 long getNavAggrERecsOffset()
          Gets the offset into the navigation aggregated record list for navigation query.
 boolean getNavAllRefinements()
          Gets whether all the navigational refinements should be returned without explictly setting them.
 DimValIdList getNavDescriptors()
          Gets the descriptor IDs of the navigation being queried for.
 DisabledRefinementsConfig getNavDisabledRefinementsConfig()
          Gets the disabled refinements config.
 boolean getNavERecSearchComputeAlternativePhrasings()
          Gets whether the Endeca MDEX Engine should compute alternative phrasings for the end user's original record search query.
 boolean getNavERecSearchDidYouMean()
          Gets whether if the "Did You Mean" feature will be returned in the supplements with the record search feature.
 ERecSearchList getNavERecSearches()
          Gets the navigation record searches on the records of the navigation query.
 boolean getNavERecSearchRewriteQueryWithAnAlternativePhrasing()
          Gets whether the Endeca MDEX Engine should use one of the alternative phrasings it has computed instead of the end user's original record search query.
 long getNavERecsOffset()
          Gets the offset into the navigation record list for the navigation query.
 int getNavERecsPerAggrERec()
          Gets the number of records returned for each aggregated record.
 DimValIdList getNavExposedRefinements()
          Gets the set of refinement parents that indicate which refinements should be returned with the navigation query.
 String getNavKeyProperties()
          Gets the navigation key properties request.
 String getNavMerchPreviewTime()
          Gets the merch preview-time string.
 String getNavMerchRuleFilter()
          Gets the merch rule filter.
 long getNavNumAggrERecs()
          Gets the maximum number of aggregated records to be returned from a navigation query.
 long getNavNumBulkAggrERecs()
          Gets the maximum number of aggregated records to be returned in bulk format from a navigation query.
 long getNavNumBulkERecs()
          Gets the maximum number of records to be returned in bulk format from a navigation query.
 long getNavNumERecs()
          Gets the maximum number of records to be returned from a navigation query.
 RangeFilterList getNavRangeFilters()
          Gets the range filters to be applied to this navigation query.
 String getNavRecordFilter()
          Gets the record filter for this navigation query.
 String getNavRecordStructureExpr()
          Gets the structure expression for this navigation query.
 RefinementConfigList getNavRefinementConfigs()
          Gets the list of dynamic refinement configs to be used by the MDEX Engine.
 ERecRank getNavRelRankERecRank()
          Gets the navigation record search specified with relevance ranking.
 ERecSearch getNavRelRankERecSearch()
          Deprecated. This method may not be supported in future versions of the MDEX Engine API - use getNavRelRankERecRank() instead. Gets the navigation record search specified with relevance ranking.
 String getNavRollupKey()
          Gets the rollup key the navigation will be rolled up by to generate aggregated records.
 String getNavSortKey()
          Deprecated. This method may not be available in future versions of the MDEX Engine API. Use getNavActiveSortKeys() instead.
 int getNavSortOrder()
          Deprecated. This method may not be available in future versions of the MDEX Engine API. Use getNavActiveSortKeys() instead.
 StratifiedDimValList getNavStratifiedDimVals()
          Sets the list of stratified dimension values for use during refinement ranking by the MDEX engine.
 Set getProfiles()
          Gets the profiles that describe characteristics of an application end user.
 ENEQueryInfo getQueryInfo()
          Gets the ENEQueryInfo object.
 FieldList getSelection()
          Gets the fields that should be returned for each record in the result set.
protected  boolean isMerchDebugOn()
           
 void setAggrERec(long aggregatedRecordId)
          Deprecated. This method may not be supported in future versions of the MDEX Engine API - use setAggrERecSpec(String) instead. Sets the ID of the aggregated record to be queried for.
 void setAggrERecActiveSortKeys(ERecSortKeyList criteria)
          Sets the list of keys that will be used to sort representative records.
 void setAggrERecNavDescriptors(DimValIdList descriptors)
          Sets the navigation values which the aggregated record will be aggregated in relation to.
 void setAggrERecNavRangeFilters(RangeFilterList filters)
          Sets the navigation range filters which the aggregated record will be composed in relation to.
 void setAggrERecNavRecordFilter(String filter)
          Sets the record filter which the aggregated record will be composed in relation to.
 void setAggrERecRollupKey(String key)
          Sets the rollup key the aggregated record is composed by.
 void setAggrERecSpec(String aggregatedRecordSpec)
          Sets the specification of the aggregated record to be queried for.
 void setAggrERecStructureExpr(String filter)
          Sets the structure expression used to filter members of the aggregated record.
 void setAnalyticsQuery(AnalyticsQuery q)
          Sets the AnalyticsQuery instance that represents the Latitude query that will be sent to the Endeca MDEX Engine.
 void setDimSearchCompound(boolean isCompound)
          Sets whether dimension search will include compound results.
 void setDimSearchDimension(long dimensionId)
          Sets the dimension which the dimension search can search from.
 void setDimSearchDimensions(DimValIdList dimensionIds)
          Sets the dimensions which the dimension search can search from.
 void setDimSearchNavDescriptors(DimValIdList descriptors)
          Sets the navigation values that describe a navigation state that restrict the number of values that can be searched from.
 void setDimSearchNavRangeFilters(RangeFilterList filters)
          Sets the navigation range filters that restrict the dimension search.
 void setDimSearchNavRecordFilter(String filter)
          Sets the record filter that will restrict the dimension search results.
 void setDimSearchNavRecordStructureExpr(String structureExpr)
          Sets the structure expression on this dimension search.
 void setDimSearchNumDimValues(int num)
          Sets the number of values returned from each dimension for value search.
 void setDimSearchOpts(String opts)
          Sets the option set that dimension search will use.
 void setDimSearchRankResults(boolean rank)
          Sets how the dimension search results are sorted.
 void setDimSearchResultsOffset(long offset)
          Sets the offset with which the dimension search will begin returning results per dimension.
 void setDimSearchTerms(String terms)
          Sets the search terms the dimension search will use.
 void setERec(long recordId)
          Deprecated. This method may not be supported in future versions of the MDEX Engine API - use setERecSpec(String) instead. Sets the ID of the record to be queried for. This method is shorthand for the setERecs(ERecIdList) method used when only requesting one record.
 void setERecs(ERecIdList recordIds)
          Sets the IDs of the records to be queried for.
 void setERecSpec(String recordSpec)
          Sets the specification of the record to be queried for.
 void setLanguageId(String id)
          Sets the ISO639 language code to be used for this query.
 void setMerchDebugOn(boolean isMerchDebugOn)
          This method is for internal Endeca use only, and should never be called
 void setNavActiveSortKeys(ERecSortKeyList criteria)
          Sets the list of keys that will be used to sort records.
 void setNavAggrERecsOffset(long offset)
          Sets the offset into the navigation aggregated record list for navigation query.
 void setNavAllRefinements(boolean all)
          Sets the query such that the navigation query will return with all the refinements possible for all dimensions.
 void setNavDescriptors(DimValIdList descriptors)
          Sets the navigation descriptor IDs that describe the navigation object to be queried for.
 void setNavDisabledRefinementsConfig(DisabledRefinementsConfig disabledRefinementsConfig)
          Sets the disabled refinements config.
 void setNavERecSearchComputeAlternativePhrasings(boolean computeAlternativePhrasings)
          Sets whether the Endeca MDEX Engine will compute alternative phrasings for the current record search query.
 void setNavERecSearchDidYouMean(boolean dymOn)
          Sets whether the record search should turn on the "Did You Mean" feature.
 void setNavERecSearches(ERecSearchList searches)
          Sets the navigation record searches to perform on the records of the navigation query.
 void setNavERecSearchRewriteQueryWithAnAlternativePhrasing(boolean rewriteQueryWithAnAlternativePhrasing)
          Sets whether the Endeca MDEX Engine will use one of the the alternative phrasings it has computed instead of the end user's original record search query when computing the set of documents to return.
 void setNavERecsOffset(long offset)
          Sets the offset into the navigation record list for the navigation query.
 void setNavERecsPerAggrERec(int number)
          Sets the maximum number of records to be returned in each aggregated record.
 void setNavExposedRefinements(DimValIdList refinementParents)
          Sets the set of refinements that should be exposed/returned with the navigation query.
 void setNavKeyProperties(String keyPropsReq)
          Set the navigation key properties request.
 void setNavMerchPreviewTime(String newTime)
          Sets the merch preview-time string.
 void setNavMerchRuleFilter(String filter)
          Sets the merch rule filter.
 void setNavNumAggrERecs(int number)
          Sets the maximum number of aggregated records returned for the navigation query.
 void setNavNumBulkAggrERecs(int number)
          Sets the maximum number of aggregated records returned in bulk format for the navigation query.
 void setNavNumBulkERecs(int number)
          Sets the maximum number of records returned in bulk format for the navigation query.
 void setNavNumERecs(int number)
          Sets the maximum number of records that can be returned for the navigation query.
 void setNavRangeFilters(RangeFilterList filters)
          Sets the navigation range filters on this navigation query.
 void setNavRecordFilter(String filter)
          Sets the record filter on this navigation query.
 void setNavRecordStructureExpr(String structureExpr)
          Sets the structure expression on this navigation query.
 void setNavRefinementConfigs(RefinementConfigList refCfgList)
          Sets the list of dynamic refinement configs to be used by the MDEX Engine.
 void setNavRelRankERecRank(ERecRank rank)
          Sets the relevance ranking record search to perform on the records of the navigation query.
 void setNavRelRankERecSearch(ERecSearch search)
          Deprecated. This method may not be supported in future versions of the MDEX Engine API - use setNavRelRankERecRank(ERecRank) instead. Sets the relevance ranking record search to perform on the records of the navigation query.
 void setNavRollupKey(String rollupKey)
          Sets the rollup key with which the records of the navigation query should be rolled up with to create aggregated records.
 void setNavSortKey(String key)
          Deprecated. This method may not be available in future versions of the MDEX Engine API. Use setNavActiveSortKeys(ERecSortKeyList) instead.
 void setNavSortOrder(int order)
          Deprecated. This method may not be available in future versions of the MDEX Engine API. Use setNavActiveSortKeys(ERecSortKeyList) instead.
 void setNavStratifiedDimVals(StratifiedDimValList stratifiedDimValList)
          Sets the list of stratified dimension values for use during refinement ranking by the MDEX engine.
 void setProfiles(Set profiles)
          Sets the profiles that describe characteristics of an application end user.
 void setQueryInfo(ENEQueryInfo queryInfo)
          Sets the ENEQueryInfo object.
 void setSelection(FieldList selectFieldList)
          Sets the fields that should be returned for each record in the result set of this navigation query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAV_SORT_ASCENDING

public static final int NAV_SORT_ASCENDING
Sort the navigation query's matching records in ascending order.

See Also:
Constant Field Values

NAV_SORT_DESCENDING

public static final int NAV_SORT_DESCENDING
Sort the navigation query's matching records in descending order.

See Also:
Constant Field Values

ALL_ERECS_PER_AGGR

public static final int ALL_ERECS_PER_AGGR
All records that compose a aggregated record will be returned.

See Also:
Constant Field Values

ONE_EREC_PER_AGGR

public static final int ONE_EREC_PER_AGGR
One of the records that compose a aggregated record will be returned.

See Also:
Constant Field Values

ZERO_ERECS_PER_AGGR

public static final int ZERO_ERECS_PER_AGGR
None of the records that compose a aggregated record will be returned.

See Also:
Constant Field Values

DIM_SEARCH_ALL_DIM_VALUES

public static final int DIM_SEARCH_ALL_DIM_VALUES
All matches from dimension search will be returned from each dimension.

See Also:
Constant Field Values

MAX_BULK_ERECS_AVAILABLE

public static final int MAX_BULK_ERECS_AVAILABLE
All the records that are associated with the current navigation state should be returned through the bulk record iterator.

See Also:
Constant Field Values

KEY_PROPS_NONE

public static final String KEY_PROPS_NONE
Request no key properties be returned.

See Also:
Constant Field Values

KEY_PROPS_ALL

public static final String KEY_PROPS_ALL
Request all key properties be returned.

See Also:
Constant Field Values
Constructor Detail

ENEQuery

public ENEQuery()
Zero argument default constructor. Without specifying specific query fields, querying with this will yield a EmptyQueryException.

Method Detail

setAnalyticsQuery

public void setAnalyticsQuery(AnalyticsQuery q)
                       throws SyntaxException
Sets the AnalyticsQuery instance that represents the Latitude query that will be sent to the Endeca MDEX Engine. If the query is malformed, it will not be set on the ENEQuery and a SyntaxException is thrown. An AnalyticsQuery instance can be built programmatically or by calling AnalyticsQuery.parseQuery(String).

Parameters:
q - the AnalyticsQuery that will be sent to the MDEX Engine.
Throws:
SyntaxException - if the AnalyticsQuery is malformed.

getAnalyticsQuery

public AnalyticsQuery getAnalyticsQuery()
Gets the AnalyticsQuery instance (if any) at the root of the AST that represents the Latitude Analytics query string.

Returns:
An AnalyticsQuery object.

setQueryInfo

public void setQueryInfo(ENEQueryInfo queryInfo)
Sets the ENEQueryInfo object. This object is used to store query-specific information (such as the session ID and query ID) for the MDEX Engine to log.

Parameters:
queryInfo - a filled ENEQueryInfo object.

getQueryInfo

public ENEQueryInfo getQueryInfo()
Gets the ENEQueryInfo object. This object can contain information such as the Session ID and the Query ID.

Returns:
An ENEQueryInfo object.

setNavDescriptors

public void setNavDescriptors(DimValIdList descriptors)
Sets the navigation descriptor IDs that describe the navigation object to be queried for. The resulting navigation object's descriptor dimensions will be ordered in the same order as these descriptors.

Parameters:
descriptors - a DimValIdList object containing the list of dimension value IDs describing the navigation to query for.

getNavDescriptors

public DimValIdList getNavDescriptors()
Gets the descriptor IDs of the navigation being queried for.

Returns:
A DimValIdList object containing the dimension value (descriptor) IDs of the navigation being queried for. Returns null if there are no navigation descriptors.

setNavERecsOffset

public void setNavERecsOffset(long offset)
Sets the offset into the navigation record list for the navigation query. Defaults to an offset of 0 if not set.

Parameters:
offset - the offset into the navigation record list.

getNavERecsOffset

public long getNavERecsOffset()
Gets the offset into the navigation record list for the navigation query.

Returns:
The offset in the navigation record list for the navigation query.

setNavNumERecs

public void setNavNumERecs(int number)
Sets the maximum number of records that can be returned for the navigation query. Defaults to 10.

Parameters:
number - an integer specifying the maximum number of records to return for the navigation query.

getNavNumERecs

public long getNavNumERecs()
Gets the maximum number of records to be returned from a navigation query.

Returns:
An integer specifying the maximum number of records to be returned from a navigation query.

setNavNumBulkERecs

public void setNavNumBulkERecs(int number)
Sets the maximum number of records returned in bulk format for the navigation query. If MAX_BULK_ERECS_AVAILABLE is passed to this method, all records for the navigation query are returned. Defaults to 0.

Parameters:
number - an integer specifying the maximum number of records to return in bulk format for the navigation query.

getNavNumBulkERecs

public long getNavNumBulkERecs()
Gets the maximum number of records to be returned in bulk format from a navigation query.

Returns:
An integer specifying the maximum number of records to be returned in bulk format from a navigation query.

setNavExposedRefinements

public void setNavExposedRefinements(DimValIdList refinementParents)
Sets the set of refinements that should be exposed/returned with the navigation query. The refinements specify a list of dimension value IDs that correlate to the parents of the refinements that should be returned with the query. If the getNavAllRefinements method returns false, no refinements will be returned and thus refinements must be specified via this set method to be returned. If getNavAllRefinements returns true, this method will be ignored unless it includes non-navigable values.

Parameters:
refinementParents - a DimValIdList object containing the IDs of parents of refinements that should be returned in the query.

getNavExposedRefinements

public DimValIdList getNavExposedRefinements()
Gets the set of refinement parents that indicate which refinements should be returned with the navigation query.

Returns:
A DimValIdList object containing the IDs of parents of the refinements that should be returned with the navigation query. Returns null if none have been specified.

setNavRefinementConfigs

public void setNavRefinementConfigs(RefinementConfigList refCfgList)
Sets the list of dynamic refinement configs to be used by the MDEX Engine.

Parameters:
refCfgList - A RefinementConfigList that encapsulates all dynamic refinement configs to be used by the MDEX Engine.

getNavRefinementConfigs

public RefinementConfigList getNavRefinementConfigs()
Gets the list of dynamic refinement configs to be used by the MDEX Engine.

Returns:
A RefinementConfigList that encapsulates all dynamic refinement configs to be used by the MDEX Engine.

setNavStratifiedDimVals

public void setNavStratifiedDimVals(StratifiedDimValList stratifiedDimValList)
Sets the list of stratified dimension values for use during refinement ranking by the MDEX engine.

Parameters:
stratifiedDimValList - A StratifiedDimValList that encapsulates all the strata to be used for refinement ranking in the MDEX Engine.

getNavStratifiedDimVals

public StratifiedDimValList getNavStratifiedDimVals()
Sets the list of stratified dimension values for use during refinement ranking by the MDEX engine.

Returns:
A StratifiedDimValList that encapsulates all the strata to be used for refinement ranking in the MDEX Engine.

setNavAllRefinements

public void setNavAllRefinements(boolean all)
Sets the query such that the navigation query will return with all the refinements possible for all dimensions. If this method sets it to false (the default), refinements must be requested explicitly via the setNavExposedRefinements method.

Parameters:
all - true if all of the refinements should be returned with the navigation query, or false if none should be returned.

getNavAllRefinements

public boolean getNavAllRefinements()
Gets whether all the navigational refinements should be returned without explictly setting them.

Returns:
true if all refinements will be returned from the navigation, or false if they will not.

setNavERecSearchComputeAlternativePhrasings

public void setNavERecSearchComputeAlternativePhrasings(boolean computeAlternativePhrasings)
Sets whether the Endeca MDEX Engine will compute alternative phrasings for the current record search query. Setting this method to true allows the application to take advantage of the Automatic Phrasing feature.

For example, if this property is set to true, then given an end user's query of:

QUERY[Ann Arbor restaurants]
the Endeca MDEX Engine, if configured appropriately, will compute:
QUERY["Ann Arbor" restaurants]
as an alternative phrasing of the end user's original record search query. The alternative phrasings will appear in either ESearchReport.getAutoSuggestions() or ESearchReport.getDYMSuggestions() depending on how getNavERecSearchRewriteQueryWithAnAlternativePhrasing() is set.

The default value of this property is false. That is, if this method is never called on an ENEQuery object, then the Endeca MDEX Engine will NOT compute alternative for the end user's original record search query. In addition, a call to the corresponding accessor method getNavERecSearchComputeAlternativePhrasings() will return false.

Parameters:
computeAlternativePhrasings - a boolean indicating whether the Endeca MDEX Engine should compute alternative phrasings for the end user's original record search query.
See Also:
getNavERecSearchComputeAlternativePhrasings(), setNavERecSearchRewriteQueryWithAnAlternativePhrasing(boolean), getNavERecSearchRewriteQueryWithAnAlternativePhrasing(), ESearchReport.getAutoSuggestions(), ESearchReport.getDYMSuggestions()

getNavERecSearchComputeAlternativePhrasings

public boolean getNavERecSearchComputeAlternativePhrasings()
Gets whether the Endeca MDEX Engine should compute alternative phrasings for the end user's original record search query. See setNavERecSearchComputeAlternativePhrasings(boolean) for detailed information about this property.

Returns:
A boolean indicating whether the Endeca MDEX Engine will compute alternative phrasings for the end user's original record search query.
See Also:
setNavERecSearchComputeAlternativePhrasings(boolean), setNavERecSearchRewriteQueryWithAnAlternativePhrasing(boolean), getNavERecSearchRewriteQueryWithAnAlternativePhrasing(), ESearchReport.getAutoSuggestions(), ESearchReport.getDYMSuggestions()

setNavERecSearchRewriteQueryWithAnAlternativePhrasing

public void setNavERecSearchRewriteQueryWithAnAlternativePhrasing(boolean rewriteQueryWithAnAlternativePhrasing)
Sets whether the Endeca MDEX Engine will use one of the the alternative phrasings it has computed instead of the end user's original record search query when computing the set of documents to return.

Note that in order for this method to have any effect, the Endeca MDEX Engine must compute alternative phrasings for the end user's original record search query. That is, the setNavERecSearchComputeAlternativePhrasings(boolean) must have been called with the value true.

The default value of this method is false. That is, if this method is never called on an ENEQuery object, the Endeca MDEX Engine will NOT use an alternative phrasing instead of the end user's original record search query to compute the set of matching documents to return. In addition, a call to the corresponding accessor method getNavERecSearchRewriteQueryWithAnAlternativePhrasing() will return false.

The alternative phrasing that was chosen to replace the end user's original record search query, if the MDEX Engine decides to make such a replacement, will be returned in a call to the ESearchReport.getAutoSuggestions() method. The alternative phrasings that were computed by the Endeca MDEX Engine but not chosen to replace the end user's original record search query will be returned in a call to the ESearchReport.getDYMSuggestions() method.

Parameters:
rewriteQueryWithAnAlternativePhrasing - a boolean indicating whether the Endeca MDEX Engine should use one of the alternative phrasings it has computed for the end user's original query instead of the end user's original query itself.
See Also:
setNavERecSearchComputeAlternativePhrasings(boolean), getNavERecSearchComputeAlternativePhrasings(), getNavERecSearchRewriteQueryWithAnAlternativePhrasing(), ESearchReport.getAutoSuggestions(), ESearchReport.getDYMSuggestions()

getNavERecSearchRewriteQueryWithAnAlternativePhrasing

public boolean getNavERecSearchRewriteQueryWithAnAlternativePhrasing()
Gets whether the Endeca MDEX Engine should use one of the alternative phrasings it has computed instead of the end user's original record search query. See setNavERecSearchRewriteQueryWithAnAlternativePhrasing(boolean) for detailed information about this setting.

Returns:
A boolean indicating whether the Endeca MDEX Engine should use one of the alternative phrasings it has computed for the end user's original query instead of the end user's original query itself.
See Also:
setNavERecSearchComputeAlternativePhrasings(boolean), getNavERecSearchComputeAlternativePhrasings(), setNavERecSearchRewriteQueryWithAnAlternativePhrasing(boolean), ESearchReport.getAutoSuggestions(), ESearchReport.getDYMSuggestions()

setProfiles

public void setProfiles(Set profiles)
Sets the profiles that describe characteristics of an application end user.

Parameters:
profiles - the set of profiles that describe an application end user. Each profile should be a java.lang.String.

getProfiles

public Set getProfiles()
Gets the profiles that describe characteristics of an application end user.

Returns:
The set of profiles that describe an application end user. This is the java.util.Set that was provided with setProfiles when it was called last. If setProfiles was never called before on this object, null is returned. Note that changing the Set returned will change the set of profiles that will be sent to the Endeca MDEX Engine.

setSelection

public void setSelection(FieldList selectFieldList)
Sets the fields that should be returned for each record in the result set of this navigation query.

Parameters:
selectFieldList - the list of fields that should be returned for each record in the result set of this navigation query.

getSelection

public FieldList getSelection()
Gets the fields that should be returned for each record in the result set.

Returns:
The list of fields that should be returned for each record in the result set of this navigation query.

setNavSortKey

public void setNavSortKey(String key)
Deprecated. This method may not be available in future versions of the MDEX Engine API. Use setNavActiveSortKeys(ERecSortKeyList) instead.

Sets the sort key with which the navigation query's records will be sorted.

Parameters:
key - Sort key with which the navigation will sort the matching records.

getNavSortKey

public String getNavSortKey()
Deprecated. This method may not be available in future versions of the MDEX Engine API. Use getNavActiveSortKeys() instead.

Gets the sort key with which the navigation query's records will be sorted.

Returns:
The sort key of the navigation query. null if there is no sort key specified.
Throws:
IllegalStateException

getNavActiveSortKeys

public ERecSortKeyList getNavActiveSortKeys()
Get the list of sort keys with which the navigation query's records will be sorted.

Returns:
The list of keys that will be used to sort the records. The order of the keys is significant. The first key is the primary sort criterion, the second key is the secondary sort criterion, and so on.

setNavActiveSortKeys

public void setNavActiveSortKeys(ERecSortKeyList criteria)
Sets the list of keys that will be used to sort records.

Parameters:
criteria - the ERecSortKeyList that contains the desired sort keys.The order of the keys is significant. The first key is the primary sort criterion, the second key is the secondary sort criterion, and so on.

setNavSortOrder

public void setNavSortOrder(int order)
Deprecated. This method may not be available in future versions of the MDEX Engine API. Use setNavActiveSortKeys(ERecSortKeyList) instead.

Sets the sort order with which the navigation query's records will be sorted. The sort order can either be NAV_SORT_ASCENDING or NAV_SORT_DESCENDING. Defaults to ascending and is only applied if the a sort key is present in query as well.

Parameters:
order - Sort order of the navigation query's records.

getNavSortOrder

public int getNavSortOrder()
Deprecated. This method may not be available in future versions of the MDEX Engine API. Use getNavActiveSortKeys() instead.

Gets the sort order with which the navigation query's matching records will be sorted.

Returns:
NAV_SORT_ASCENDING if ascending, NAV_SORT_DESCENDING if descending.

setNavRollupKey

public void setNavRollupKey(String rollupKey)
Sets the rollup key with which the records of the navigation query should be rolled up with to create aggregated records. By setting a key with this method, aggregated Endeca records (AggERec objects) will be returned by the navigation query instead of Endeca records (ERec objects).

Parameters:
rollupKey - The Endeca property or dimension that will be used to roll up the records of the navigation query in order to create aggregated Endeca records.

getNavRollupKey

public String getNavRollupKey()
Gets the rollup key the navigation will be rolled up by to generate aggregated records.

Returns:
The rollup key of the navigation. null if none is specified.

setNavAggrERecsOffset

public void setNavAggrERecsOffset(long offset)
Sets the offset into the navigation aggregated record list for navigation query. Defaults to an offset of 0 if not set. Only applicable when a aggregated record set is queried for.

Parameters:
offset - Offset into the navigation aggregated record list.

getNavAggrERecsOffset

public long getNavAggrERecsOffset()
Gets the offset into the navigation aggregated record list for navigation query.

Returns:
The offset in the navigation aggregated record list for navigation query.

setNavNumAggrERecs

public void setNavNumAggrERecs(int number)
Sets the maximum number of aggregated records returned for the navigation query. Defaults to 10. Only applicable for aggregated record navigation queries.

Parameters:
number - Maximum number of aggregated records to return for the navigation query.

getNavNumAggrERecs

public long getNavNumAggrERecs()
Gets the maximum number of aggregated records to be returned from a navigation query.

Returns:
Maximum number of aggregated records to be returned from a navigation query.

setNavERecsPerAggrERec

public void setNavERecsPerAggrERec(int number)
Sets the maximum number of records to be returned in each aggregated record. Defaults to one. Only applicable for aggregated record navigation queries. Values possible include ALL_ERECS_PER_AGGR, ONE_EREC_PER_AGGR, or ZERO_ERECS_PER_AGGR.

Parameters:
number - Maximum number of records to return per aggregated record.

getNavERecsPerAggrERec

public int getNavERecsPerAggrERec()
Gets the number of records returned for each aggregated record.

Returns:
Number of records for each aggregated record. Value returned can be one of: ALL_ERECS_PER_AGGR, ONE_EREC_PER_AGGR, or ZERO_ERECS_PER_AGGR.

setNavNumBulkAggrERecs

public void setNavNumBulkAggrERecs(int number)
Sets the maximum number of aggregated records returned in bulk format for the navigation query. If MAX_BULK_ERECS_AVAILABLE is specified, all aggregated records for the navigation query will be returned. Only applicable for aggregated record navigation queries. Defaults to 0.

Parameters:
number - Maximum number of aggregated records to return in bulk format for the navigation query.

getNavNumBulkAggrERecs

public long getNavNumBulkAggrERecs()
Gets the maximum number of aggregated records to be returned in bulk format from a navigation query.

Returns:
Maximum number of aggregated records to be returned in bulk format from a navigation query.

setNavERecSearches

public void setNavERecSearches(ERecSearchList searches)
Sets the navigation record searches to perform on the records of the navigation query. The individual elements of this list are applied in a conjunctive manner in that each search narrows and restricts the results of navigation record list.

Parameters:
searches - Record searches to apply to this navigation.

getNavERecSearches

public ERecSearchList getNavERecSearches()
Gets the navigation record searches on the records of the navigation query.

Returns:
Navigation record searches applied to records of the navigation. null if none have been previously specified.

setNavRelRankERecRank

public void setNavRelRankERecRank(ERecRank rank)
Sets the relevance ranking record search to perform on the records of the navigation query.

Parameters:
rank - Relevance Ranking to apply to this navigation.

getNavRelRankERecRank

public ERecRank getNavRelRankERecRank()
Gets the navigation record search specified with relevance ranking.

Returns:
Navigation record search specified with relevance ranking. null if no relevance ranking record search has been specified.

setNavRelRankERecSearch

public void setNavRelRankERecSearch(ERecSearch search)
Deprecated. This method may not be supported in future versions of the MDEX Engine API - use setNavRelRankERecRank(ERecRank) instead. Sets the relevance ranking record search to perform on the records of the navigation query.

Parameters:
search - Relevance Ranking to apply to this navigation.

getNavRelRankERecSearch

public ERecSearch getNavRelRankERecSearch()
Deprecated. This method may not be supported in future versions of the MDEX Engine API - use getNavRelRankERecRank() instead. Gets the navigation record search specified with relevance ranking.

Returns:
Navigation record search specified with relevance ranking. null if no relevance ranking record search has been specified.

setNavERecSearchDidYouMean

public void setNavERecSearchDidYouMean(boolean dymOn)
Sets whether the record search should turn on the "Did You Mean" feature. Only used if a record search query is being made with the navigation. Defaults to false

Parameters:
dymOn - true if the "Did You Mean" feature is enabled for record search, or false if it is not.

getNavERecSearchDidYouMean

public boolean getNavERecSearchDidYouMean()
Gets whether if the "Did You Mean" feature will be returned in the supplements with the record search feature.

Returns:
true if the "Did You Mean" feature is enabled, false if it is not.

setNavRangeFilters

public void setNavRangeFilters(RangeFilterList filters)
Sets the navigation range filters on this navigation query. Range filters limit the record results of the query.

Parameters:
filters - Range filters of the navigation query.

getNavRangeFilters

public RangeFilterList getNavRangeFilters()
Gets the range filters to be applied to this navigation query.

Returns:
The navigation range filters of this query or null if none are returned.

setNavRecordFilter

public void setNavRecordFilter(String filter)
Sets the record filter on this navigation query. Record filters are boolean expressions that limit the record results of the query.

Parameters:
filter - Record filter for the navigation query.

getNavRecordFilter

public String getNavRecordFilter()
Gets the record filter for this navigation query.

Returns:
The record filter for this query or null if none is set.

setNavRecordStructureExpr

public void setNavRecordStructureExpr(String structureExpr)
Sets the structure expression on this navigation query.

Parameters:
structureExpr - Structure expression for the navigation query.

getNavRecordStructureExpr

public String getNavRecordStructureExpr()
Gets the structure expression for this navigation query.

Returns:
The navigation structure expression for the query or null if none is set.

setNavKeyProperties

public void setNavKeyProperties(String keyPropsReq)
Set the navigation key properties request.

Parameters:
keyPropsReq - must be one of KEY_PROPS_NONE or KEY_PROPS_ALL.

getNavKeyProperties

public String getNavKeyProperties()
Gets the navigation key properties request.

Returns:
One of KEY_PROPS_NONE or KEY_PROPS_ALL.

setERecSpec

public void setERecSpec(String recordSpec)
Sets the specification of the record to be queried for. This method is shorthand for the setERecs(ERecIdList) method used when only requesting one record.

Parameters:
recordSpec - The record specification of the record being queried for.

setERecs

public void setERecs(ERecIdList recordIds)
Sets the IDs of the records to be queried for.

Parameters:
recordIds - The record IDs of the records being queried for.

getERecs

public ERecIdList getERecs()
Gets the IDs of the records being queried for. If only one record has been queried for this method still returns a ERecIdList of one element.

Returns:
The record IDs in the query or null if there were none.

setAggrERecSpec

public void setAggrERecSpec(String aggregatedRecordSpec)
Sets the specification of the aggregated record to be queried for.

Parameters:
aggregatedRecordSpec - The aggregated record specification of the aggregated record being queried for.

getAggrERecSpec

public String getAggrERecSpec()
Gets the specification of the aggregated record to be queried for.

Returns:
The aggregated record specification of the aggregated record being queried for.

setAggrERecNavDescriptors

public void setAggrERecNavDescriptors(DimValIdList descriptors)
Sets the navigation values which the aggregated record will be aggregated in relation to.

Parameters:
descriptors - Navigation value ids of the aggregated record is relative to.

getAggrERecNavDescriptors

public DimValIdList getAggrERecNavDescriptors()
Gets the navigation values which the aggregated record will be composed in relation to.

Returns:
Navigation value ids of the aggregated record is relative to. null if none are specified.

setAggrERecNavRangeFilters

public void setAggrERecNavRangeFilters(RangeFilterList filters)
Sets the navigation range filters which the aggregated record will be composed in relation to.

Parameters:
filters - Navigation range filters the aggregated record is composed relative to.

getAggrERecNavRangeFilters

public RangeFilterList getAggrERecNavRangeFilters()
Gets the navigation range filters which the aggregated record will be composed in relation to.

Returns:
The navigation range filters the aggregated record is composed relative to. null if none is present.

setAggrERecNavRecordFilter

public void setAggrERecNavRecordFilter(String filter)
Sets the record filter which the aggregated record will be composed in relation to.

Parameters:
filter - Record filter the aggregated record is composed relative to.

getAggrERecNavRecordFilter

public String getAggrERecNavRecordFilter()
Gets the record filter which the aggregated record will be composed in relation to.

Returns:
The record filter the aggregated record is composed relative to. null if none is present.

setAggrERecStructureExpr

public void setAggrERecStructureExpr(String filter)
Sets the structure expression used to filter members of the aggregated record.

Parameters:
filter - structure expression used to filter members of the aggregated record.

getAggrERecStructureExpr

public String getAggrERecStructureExpr()
Gets the structure expression used to filter members of the aggregated record.

Returns:
The structure expression used to filter members of the aggregated record.

setAggrERecRollupKey

public void setAggrERecRollupKey(String key)
Sets the rollup key the aggregated record is composed by.

Parameters:
key - Rollup key to compose the aggregated record.

getAggrERecRollupKey

public String getAggrERecRollupKey()
Gets the rollup key the aggregated record is composed by.

Returns:
Rollup key to compose the aggregated record. null if none are specified.

getAggrERecActiveSortKeys

public ERecSortKeyList getAggrERecActiveSortKeys()
Get the list of sort keys with which the aggregated records representative records will be sorted.

Returns:
The list of keys that will be used to sort the records. The order of the keys is significant. The first key is the primary sort criterion, the second key is the secondary sort criterion, and so on.

setAggrERecActiveSortKeys

public void setAggrERecActiveSortKeys(ERecSortKeyList criteria)
Sets the list of keys that will be used to sort representative records.

Parameters:
criteria - the ERecSortKeyList that contains the desired sort keys.The order of the keys is significant. The first key is the primary sort criterion, the second key is the secondary sort criterion, and so on.

setDimSearchTerms

public void setDimSearchTerms(String terms)
Sets the search terms the dimension search will use. The form of terms is that of the form the end user inputted, that is decoded and untokenized.

Parameters:
terms - Dimension search terms.

setDimSearchOpts

public void setDimSearchOpts(String opts)
Sets the option set that dimension search will use.

Parameters:
opts - Dimension search options.

setDimSearchCompound

public void setDimSearchCompound(boolean isCompound)
Sets whether dimension search will include compound results.


getDimSearchTerms

public String getDimSearchTerms()
Gets the search terms the dimension search will use.

Returns:
Dimension search terms.

getDimSearchOpts

public String getDimSearchOpts()
Gets the search options that dimension search will use.

Returns:
Dimension search options.

getDimSearchCompound

public boolean getDimSearchCompound()
Gets whether that dimension search will include compound results.

Returns:
Dimension search options.

setDimSearchNavDescriptors

public void setDimSearchNavDescriptors(DimValIdList descriptors)
Sets the navigation values that describe a navigation state that restrict the number of values that can be searched from. By specifying a navigation restriction, the dimension search is not made from the entire space of values, but instead just the values that are still available as refinements from the specified navigation state.

Parameters:
descriptors - Values that describe a navigation state restriction on the searchable values.

getDimSearchNavDescriptors

public DimValIdList getDimSearchNavDescriptors()
Gets the navigation values that restrict the dimension search.

Returns:
Navigation values that restrict the dimension search.

setDimSearchNavRangeFilters

public void setDimSearchNavRangeFilters(RangeFilterList filters)
Sets the navigation range filters that restrict the dimension search. Range filters limit the navigation record restrictions.

Parameters:
filters - Navigation range filters of the dimension search query.

getDimSearchNavRangeFilters

public RangeFilterList getDimSearchNavRangeFilters()
Gets the navigation range filters that restrict the dimension search.

Returns:
The navigation range filters that restrict this dimension search query or null if none are present.

setDimSearchNavRecordFilter

public void setDimSearchNavRecordFilter(String filter)
Sets the record filter that will restrict the dimension search results. This filter restricts the scope of the records that will be considered for a dimension search. Only dimension values represented on at least one record satisfying the specified filter are returned as search results.

Parameters:
filter - Record filter for the dimension search query.

getDimSearchNavRecordFilter

public String getDimSearchNavRecordFilter()
Gets the record filter for the current dimension search.

Returns:
The record filter for the dimension search query. null if none is present.

setDimSearchNavRecordStructureExpr

public void setDimSearchNavRecordStructureExpr(String structureExpr)
Sets the structure expression on this dimension search.

Parameters:
structureExpr - Structure expression for the dimension search.

getDimSearchNavRecordStructureExpr

public String getDimSearchNavRecordStructureExpr()
Gets the structure expression for this dimension search.

Returns:
The navigation structure expression for the query or null if none is set.

setDimSearchDimension

public void setDimSearchDimension(long dimensionId)
Sets the dimension which the dimension search can search from. If none is specified, dimension search searches from all dimensions.

Parameters:
dimensionId - The dimension id of the dimension that value search can search from.

setDimSearchDimensions

public void setDimSearchDimensions(DimValIdList dimensionIds)
Sets the dimensions which the dimension search can search from. If none is specified, dimension search searches from all dimensions.

Parameters:
dimensionIds - The dimension ids of the dimension that value search can search from.

getDimSearchDimension

public long getDimSearchDimension()
If calling getDimSearchDimensions() would return a list with a single value, that value will be returned by this function. Otherwise, returns -1.

Returns:
A single value if relevant, -1 if no values or more than one value are available.

getDimSearchDimensions

public DimValIdList getDimSearchDimensions()
Gets the dimensions from which the dimension search can search from.

Returns:
The dimension ids of the dimensions that the dimension search can search from.

setDimSearchNumDimValues

public void setDimSearchNumDimValues(int num)
Sets the number of values returned from each dimension for value search. Defaults to all (DIM_SEARCH_ALL_DIM_VALUES).

Parameters:
num - Number of values to be returned in each dimension.

getDimSearchNumDimValues

public int getDimSearchNumDimValues()
Gets the number of values returned from each dimension for value search. Defaults to all (DIM_SEARCH_ALL_DIM_VALUES).

Returns:
Number of values returned from each dimension. -1 indicates all and is the default.

setDimSearchResultsOffset

public void setDimSearchResultsOffset(long offset)
Sets the offset with which the dimension search will begin returning results per dimension. This option is only meaningful after setting setDimSearchNumDimValues. Defaults to 0.

Parameters:
offset - Offset into each dimension of results.

getDimSearchResultsOffset

public long getDimSearchResultsOffset()
Gets the offset with which the dimension search will return values per dimension.

Returns:
The offset into each dimension search result dimension.

setDimSearchRankResults

public void setDimSearchRankResults(boolean rank)
Sets how the dimension search results are sorted. Specifying true means that relevance ranking is used to sort dimension search results, while false means that default dimension value ranking (alpha, numeric, or manual, as set in Developer Studio) is used to order dimension search results. The default is false, meaning that default dimension value ranking is used, not relevance ranking.

Parameters:
rank - true to use relevance ranking to sort dimension search results, or false to use the default dimension value ranking.

getDimSearchRankResults

public boolean getDimSearchRankResults()
Gets how the dimension search results will be sorted. The results are ordered by using either relevance ranking or the default dimension value ranking (alpha, numeric, or manual, as set in Developer Studio).

Returns:
true if relevance ranking is used or false if the default dimension value ranking is used.

setMerchDebugOn

public void setMerchDebugOn(boolean isMerchDebugOn)
This method is for internal Endeca use only, and should never be called


isMerchDebugOn

protected boolean isMerchDebugOn()

setLanguageId

public void setLanguageId(String id)
Sets the ISO639 language code to be used for this query. The language ID is sent to the MDEX Engine when the query is executed, and specifies the language of any text portion of the query. For example: search terms.

Parameters:
id - The String representing an ISO639 language code.

getLanguageId

public String getLanguageId()
Gets the ISO639 language ID to be used for this query.

Returns:
The String representing an ISO639 language code, or null if a language ID has not been set.

containsNavQuery

public boolean containsNavQuery()
Returns whether the query includes a navigation query.

Returns:
true if query includes a request for a navigation object and false if it does not.

containsERecQuery

public boolean containsERecQuery()
Returns if this query includes a record query. This method is synonymous with containsERecsQuery and is here for completeness when requesting only one record.

Returns:
true if query includes a record query. false if it does not.

containsERecsQuery

public boolean containsERecsQuery()
Returns if this query includes a query for records.

Returns:
true if query includes a query for one or more records. false if it does not.

containsAggrERecQuery

public boolean containsAggrERecQuery()
Returns if this query includes a aggregated record query.

Returns:
true if query includes a aggregated record query. false if it does not.

containsDimSearchQuery

public boolean containsDimSearchQuery()
Returns if this query includes a dimension search query.

Returns:
true if query includes a dimension search query. false if it does not.

containsQuery

public boolean containsQuery()
Returns whether the query is querying for any of a navigation, record, dimension search, or a value set search.

Returns:
false if a navigation, record, dimension search, value set search are specified in query. true if none are.

getNavMerchPreviewTime

public String getNavMerchPreviewTime()
Gets the merch preview-time string.


setNavMerchPreviewTime

public void setNavMerchPreviewTime(String newTime)
Sets the merch preview-time string. Allows null.


getNavMerchRuleFilter

public String getNavMerchRuleFilter()
Gets the merch rule filter.


setNavMerchRuleFilter

public void setNavMerchRuleFilter(String filter)
Sets the merch rule filter. Allows null.


getNavDisabledRefinementsConfig

public DisabledRefinementsConfig getNavDisabledRefinementsConfig()
Gets the disabled refinements config.


setNavDisabledRefinementsConfig

public void setNavDisabledRefinementsConfig(DisabledRefinementsConfig disabledRefinementsConfig)
Sets the disabled refinements config. A null disabled refinements config means that no disabled refinements will be returned.


setERec

public void setERec(long recordId)
Deprecated. This method may not be supported in future versions of the MDEX Engine API - use setERecSpec(String) instead. Sets the ID of the record to be queried for. This method is shorthand for the setERecs(ERecIdList) method used when only requesting one record.

Parameters:
recordId - The record ID of the record being queried for.

setAggrERec

public void setAggrERec(long aggregatedRecordId)
Deprecated. This method may not be supported in future versions of the MDEX Engine API - use setAggrERecSpec(String) instead. Sets the ID of the aggregated record to be queried for.

Parameters:
aggregatedRecordId - The aggregated record ID of the aggregated record being queried for.

getAggrERec

public long getAggrERec()
                 throws NumberFormatException
Deprecated. This method may not be supported in future versions of the MDEX Engine API - use getAggrERecSpec() instead. Gets the ID of the aggregated record to be queried for.

Returns:
The aggregated record ID of the aggregated record being queried for.
Throws:
NumberFormatException


2010 Endeca Technologies, Inc.
Endeca Confidential