com.endeca.navigation
Class ESearchReport

java.lang.Object
  extended by com.endeca.navigation.ESearchReport

public class ESearchReport
extends Object

ESearchReport objects contain detailed information about record searches. Use Navigation.getESearchReports() to obtain a Map of ESearchReport objects.

A single ESearchReport object contains information about a single search key. If a query is submitted to the Endeca MDEX Engine with multiple keys, Navigation.getESearchReports() will return a Map that contains an ESearchReport object for each search key that was submitted.

For example, in this query:

N=0&Ntk=Name|Flavors&Ntt=merlot|fruity
the resulting Map will have two entries, one for each search key.


Nested Class Summary
static class ESearchReport.Mode
          Enumeration of Endeca search modes.
 
Field Summary
static ESearchReport.Mode MODE_ALL
          Match all user search terms (i.e., perform a conjunctive search).
static ESearchReport.Mode MODE_ALL_ANY
          Match all user search terms if possible, otherwise match at least one.
static ESearchReport.Mode MODE_ALL_PARTIAL
          Match all user search terms if possible, otherwise match some.
static ESearchReport.Mode MODE_ANY
          Match at least one user search term.
static ESearchReport.Mode MODE_BOOLEAN
          Match using a Boolean query.
static ESearchReport.Mode MODE_PARTIAL
          Match some user search terms.
static ESearchReport.Mode MODE_PARTIAL_MAX
          Match a maximal subset of user search terms.
static ESearchReport.Mode MODE_UNKNOWN
          The mode is unknown.
 
Method Summary
 List getAutoSuggestions()
          Returns the list of automatic spelling corrections and/or alternative phrasing suggestions made by the Endeca MDEX Engine.
 List getDYMSuggestions()
          Returns the list of "Did You Mean" suggestions made by the Endeca MDEX Engine.
 String getErrorMessage()
          Returns the MDEX Engine's error message if the search was not valid.
 String getKey()
          Returns the key used in the record search.
 ESearchReport.Mode getMatchedMode()
          Returns the matched search mode that was selected by the MDEX Engine.
 ESearchReport.Mode getMode()
          Returns the requested search mode used in the search.
 long getNumMatchedTerms()
          Returns the number of search terms that were sucessfully matched when the search was performed.
 long getNumMatchingResults()
          Returns the number of records that matched the search.
 String getTerms()
          Returns the terms specified in the record search.
 String getTruncatedTerms()
          Returns a set of search terms after truncation.
 PropertyMap getWordInterps()
          Returns the word interpretations for the record search.
 boolean isValid()
          Returns true if the search was a valid search.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_ALL

public static final ESearchReport.Mode MODE_ALL
Match all user search terms (i.e., perform a conjunctive search). This is the default mode.


MODE_ANY

public static final ESearchReport.Mode MODE_ANY
Match at least one user search term.


MODE_PARTIAL

public static final ESearchReport.Mode MODE_PARTIAL
Match some user search terms.


MODE_PARTIAL_MAX

public static final ESearchReport.Mode MODE_PARTIAL_MAX
Match a maximal subset of user search terms.


MODE_BOOLEAN

public static final ESearchReport.Mode MODE_BOOLEAN
Match using a Boolean query.


MODE_ALL_ANY

public static final ESearchReport.Mode MODE_ALL_ANY
Match all user search terms if possible, otherwise match at least one.


MODE_ALL_PARTIAL

public static final ESearchReport.Mode MODE_ALL_PARTIAL
Match all user search terms if possible, otherwise match some.


MODE_UNKNOWN

public static final ESearchReport.Mode MODE_UNKNOWN
The mode is unknown.

Method Detail

getKey

public String getKey()
Returns the key used in the record search. Corresponds to the Ntk parameter of a UrlENEQuery.

Returns:
A String containing the search key, or null if no key has been specified.

getTerms

public String getTerms()
Returns the terms specified in the record search. Corresponds to the Ntt parameter of a UrlENEQuery. If the query was truncated for performance reasons, use getTruncatedTerms to get the truncated terms.

Returns:
A String containing the terms specified in the search, or null if no terms have been specified.

getMode

public ESearchReport.Mode getMode()
Returns the requested search mode used in the search. Corresponds to the Ntk parameter of a UrlENEQuery.

Returns:
The search mode that was requested when the search was performed
See Also:
ESearchReport.Mode

getMatchedMode

public ESearchReport.Mode getMatchedMode()
Returns the matched search mode that was selected by the MDEX Engine. This method is different from getMode() in that getMatchedMode returns the match mode that was actually selected by the MDEX Engine as opposed to the match mode that was requested in the query.

For example, assume that the following query was issued to the MDEX Engine:

N=0&Ntk=all&Ntt=merlot+blackberry&Ntx=mode+matchallany
The query is searching for the terms merlot and blackberry and is requesting the match mode of MODE_ALL_ANY. This search mode will first attempt to perform a search that matches all of the terms; failing that, it will perform a search that matches any of the terms. Assuming there are no occurrences of blackberry, the resulting match mode will be MODE_ANY.

Returns:
The match mode selected by the MDEX Engine.
See Also:
MODE_ALL, MODE_ANY

getNumMatchingResults

public long getNumMatchingResults()
Returns the number of records that matched the search. Corresponds to the Navigation.getTotalNumERecs() method.

Returns:
The number of records that matched the search.

getWordInterps

public PropertyMap getWordInterps()
Returns the word interpretations for the record search. A word interpretation is the treatment of one or more query terms as some other terms during search processing.

For example, assume the index contains the following thesaurus entry:

cab > cabernet
If a search is performed for the term "cab" and there is a match for "cabernet", a single word interpretation will be returned with the key "cab" and a value of "cabernet".

In the Automatic Phrasing feature, for each contiguous subsequence of query terms that was treated as a quoted phrase during search processing, a word interpretation will be returned with the original query terms as the key and the query terms in double quotes as the value.

Note that the MDEX Engine's --wordinterp flag must be used to obtain any results from getWordInterps.

Returns:
A PropertyMap representing the set of word interpretations.

getAutoSuggestions

public List getAutoSuggestions()
Returns the list of automatic spelling corrections and/or alternative phrasing suggestions made by the Endeca MDEX Engine.

Alternative phrasing suggestions are used by the MDEX Engine as the query to compute the set of matching documents returned instead of the user's original search query. Alternative phrasing suggestions can be returned under one of the following scenarios:

An example of having both Spelling Correction and Automatic Phrasing is if a user's query of:

QUERY[New Yorkk restaurants]
is rewritten to an alternative phrasing suggestion of:
QUERY["New York" restaurants]
Here the term "Yorkk" was spell-corrected to "York" and the resulting terms "New" and "York" were suggested to be phrased by the Endeca MDEX Engine as "New York". Only those suggestions that, when issued as queries, would return one or more records (before any navigation filters are applied) will be returned.

Returns:
A List collection of ESearchAutoSuggestion objects. If there are no suggestions, the list will be empty. You can use the Java List.isEmpty() method to find out if the list contains any elements.
See Also:
ENEQuery.setNavERecSearchComputeAlternativePhrasings(boolean), ENEQuery.getNavERecSearchComputeAlternativePhrasings(), ENEQuery.setNavERecSearchRewriteQueryWithAnAlternativePhrasing(boolean), ENEQuery.getNavERecSearchRewriteQueryWithAnAlternativePhrasing(), getDYMSuggestions()

getDYMSuggestions

public List getDYMSuggestions()
Returns the list of "Did You Mean" suggestions made by the Endeca MDEX Engine. "Did You Mean" suggestions can be returned under the following scenarios:

An example of having both Spelling Correction and Automatic Phrasing is if a user's query of:

QUERY[New Yorkk restaurants]
is rewritten to an alternative phrasing suggestion of:
QUERY["New York" restaurants]
Here the term "Yorkk" was spell corrected to "York" and the resulting terms "New" and "York" were suggested to be phrased by the MDEX Engine as "New York". Only those suggestions that, when issued as queries, would return one or more records (before any navigation filters are applied) will be returned.

Returns:
A List collection containing ESearchDYMSuggestion objects. If there are no "Did You Mean" suggestions, the list will be empty. You can use the Java List.isEmpty() method to find out if the list contains any elements.
See Also:
ENEQuery.setNavERecSearchComputeAlternativePhrasings(boolean), ENEQuery.getNavERecSearchComputeAlternativePhrasings(), ENEQuery.setNavERecSearchRewriteQueryWithAnAlternativePhrasing(boolean), ENEQuery.getNavERecSearchRewriteQueryWithAnAlternativePhrasing(), getAutoSuggestions()

getErrorMessage

public String getErrorMessage()
Returns the MDEX Engine's error message if the search was not valid.

Returns:
A String representing the error message, or null if there is no error.

isValid

public boolean isValid()
Returns true if the search was a valid search. If isValid returns false, check the value of getErrorMessage() for a description of the error.

Returns:
true if the search was a valid search, false otherwise.

getNumMatchedTerms

public long getNumMatchedTerms()
Returns the number of search terms that were sucessfully matched when the search was performed. Note that the number of matched terms may be different than the number of terms returned from getTerms() if the search mode was MODE_ANY.

Returns:
The number of terms that matched.

getTruncatedTerms

public String getTruncatedTerms()
Returns a set of search terms after truncation. If the number of search terms is too large, the MDEX Engine will truncate the query for performance reasons. In this case, getTruncatedTerms returns the new set of search terms after the MDEX Engine has performed the truncation.

Returns:
A String representing the truncated search terms, or null if no truncation was performed.
See Also:
getTerms()


2010 Endeca Technologies, Inc.
Endeca Confidential