public class CSSearchMultiple extends CSItemMultiple
A connection is made to a Solr server at a known hostname and port number. A search is instigated on the server and the results read back.
For the iCM article collection, the article ID, article heading, article introductory text, and article text values are searched. For the iCM media collection, the media ID, keywords, title, and description values are searched. For the iCM forum collection, the message ID, subject, author and body are searched. For the iCM product collection, the product type ID, product name, short description, and long description are searched. For the iCM site user collection , the username, description, and values of any searchable profile fields are searched.
In Solr the exact processing of a search query depends on the fields being queried and their definition within the Solr schema. By default searches are performed against the 'body' field. This field will contains all of the textual content of an article, media item etc. The default processing of the 'body' field means that all searches will be case insensitive and english language stemming and stop words applied. Stemming means that various forms of the same work will match. For example a search for 'interesting' will also match 'interest' and 'intrested'. Stop would removes very common english words like 'the' and 'and' from search queries.
For user-defined collections, search results will be dependent on the information contained within the collection. The key information inserted for each item within the user-defined collection must be in the format <Item ID>_<Item Type>, where 'Item ID' is the item's unique identifier and 'Item Type' is the label that identifies the item's type. Refer to the iCM Housekeeping section for further details on setting up user-defined collections.
KEYWORD SEARCHING
At its most basic, the setKeywords
method should be a space-delimited list of search
keywords. The default operator will automatically be inserted in between each keyword (except for
<MANY>
which will be discussed later); use the
setKeywordOperator
method to specify a default operator of
<OR>, <AND>
, <ACCRUE>
or <MANY>
.
ACCRUE
is the default. If required, the setKeywords
method will also accept the
following explicitly specified operators :
AND <AND> OR <OR> NOT <NOT> <ACCRUE>
In addition, the '(' and ')' brackets may be used to group keywords, and double-quotes may be used to wrap a keyword
or set of keywords indicating that they should be treated as an exact phrase.
If the default operator is set to <MANY>
, the list of search keywords will be converted into a
comma-delimited list, wrapped in the '(' and ')' brackets and with the operator <MANY>
prepended. If another operator is found in the search keywords list it will be removed since mixing these and
<MANY>
is not legal Solr Query Language syntax.
By default, stemming is enabled and so a keyword of 'film' will search for 'film', 'films', 'filming', etc. Double
quotation marks may be used to wrap an individual keyword if stemming is not required in that particular instance.
Stemming may be turned off completely by setting the setKeywordStemming
method
to 'False'. Double quotation marks will be automatically inserted around each supplied keyword indicating that only
exact keyword matches should be undertaken.
Only the operators listed earlier may be used within the setKeywords
method. The following characters
that have special meaning to Solr will therefore be escaped unless within a double-quoted phrase (and unless
specified as additional valid operators by the 'setKeywordsXXXOperators' methods :
,[=<>!'@`{
SAMPLE KEYWORDS
KEYWORDS | RESULTING SEARCH |
---|---|
low brass instrument | low ACCRUE brass ACCRUE instrument |
low OR brass OR instrument | low OR brass OR instrument |
film | If stemming is enabled : film, films, filming, or filmed If stemming is disabled : film |
"film" | If stemming is enabled : film If stemming is disabled : film |
"low brass instrument" | The phrase 'low brass instrument' |
filming AND fun | If stemming is enabled : film, films, filming, or filmed, AND fun If stemming is disabled : filming AND fun |
filming NOT fun | If stemming is enabled : film, films, filming, or filmed, NOT fun If stemming is disabled : filming NOT fun |
SEARCHCOMMAND SEARCHING
Use the setSearchCommand
method to perform more complex searches using the full set
of Solr operators and modifiers. By default, any search criteria specified via the other properties (setRootArticleIDs
for example) shall be ignored (SEARCHCOMMAND_ACTION_OVERRIDE_ALL)
. If you wish to use the
SearchCommand
method in conjunction with these other parameters, set the
setSearchCommandAction
method to
SEARCHCOMMAND_ACTION_OVERRIDE_KEYWORDS
.
NOTE that no default operators are implemented for the setSearchCommand
method; as such the command 'A
B C' will be taken to be an exact phrase search, the default Solr behaviour.
EXAMPLES
Search the iCM Article collection :
try
{
CSSearchMultiple obj = new CSSearchMultiple("dbprops.dat");
obj.setLuceneRepositoryPath("http://localhost:5506/solrsite");
obj.setCollectionNameList("Article");
obj.setKeywords("test OR article");
obj.get();
Iterator iter = obj.iterator();
while ( iter.hasNext() )
{
CSSearchItem item = (CSSearchItem)iter.next();
System.err.println("Title : " + item.getTitle());
System.err.println("Score : " + item.getScore());
}
}
catch ( CSException e )
{
System.err.println("ERROR : " + e.getMessage());
}
Search the iCM Media collection :
try
{
CSSearchMultiple obj = new CSSearchMultiple("dbprops.dat");
obj.setLuceneRepositoryPath("http://localhost:5506/solrsite");
obj.setCollectionNameList("Media");
obj.setKeywords(strKeywords);
obj.setMediaGroupNames("news_photos,product_photos");
obj.setMediaTypeNames("images");
obj.get();
Iterator iter = obj.iterator();
while ( iter.hasNext() )
{
CSSearchItem item = (CSSearchItem)iter.next();
System.err.println("Title : " + item.getTitle());
System.err.println("Score : " + item.getScore());
}
}
catch ( CSException e )
{
System.err.println("ERROR : " + e.getMessage());
}
Search the iCM Forum collection :
try
{
CSSearchMultiple obj = new CSSearchMultiple("dbprops.dat");
obj.setLuceneRepositoryPath("http://localhost:5506/solrsite");
obj.setCollectionNameList("Message");
obj.setKeywords(strKeywords);
obj.setForumIDs(lstForumIDs);
obj.setThreadIDs(lstThreadIDs);
obj.get();
Iterator iter = obj.iterator();
while ( iter.hasNext() )
{
CSSearchItem item = (CSSearchItem)iter.next();
System.err.println("Title : " + item.getTitle());
System.err.println("Score : " + item.getScore());
}
}
catch ( CSException e )
{
System.err.println("ERROR : " + e.getMessage());
}
* Search the iCM Site User collection :
try
{
CSSearchMultiple obj = new CSSearchMultiple("dbprops.dat");
obj.setLuceneRepositoryPath("http://localhost:5506/solrsite");
obj.setCollectionNameList("SiteUser");
obj.setKeywords(strKeywords);
obj.get();
Iterator iter = obj.iterator();
while ( iter.hasNext() )
{
CSSearchItem item = (CSSearchItem)iter.next();
System.err.println("Title : " + item.getTitle());
System.err.println("Score : " + item.getScore());
}
}
catch ( CSException e )
{
System.err.println("ERROR : " + e.getMessage());
}
Search the iCM article and media collections along with a user-defined collection. Include only Word document media
items and only search items from the specified subsite :
try
{
CSSearchMultiple obj = new CSSearchMultiple("dbprops.dat");
obj.setLuceneRepositoryPath("http://localhost:5506/solrsite");
obj.setCollectionNameList(strArticleCollectionName + "," + strMediaCollectionName + "," + strMyCollectionName);
obj.setKeywords(strKeywords);
obj.setSubsiteID(nSubsiteID);
obj.setMediaTypeNames("docs");
obj.get();
Iterator iter = obj.iterator();
while ( iter.hasNext() )
{
CSSearchItem item = (CSSearchItem)iter.next();
System.err.println("Title : " + item.getTitle());
System.err.println("Score : " + item.getScore());
}
}
catch ( CSException e )
{
System.err.println("ERROR : " + e.getMessage());
}
CSSearchItem
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
FACET_DATE_END
Value that can be passed to the
addFacetParameter(String, String, String) function to specify the end of the facet date range for a specific field. |
static java.lang.String |
FACET_DATE_GAP
Value that can be passed to the
addFacetParameter(String, String, String) function to specify the facet date gap for a specific field. |
static java.lang.String |
FACET_DATE_START
Value that can be passed to the
addFacetParameter(String, String, String) function to specify the start of the facet date range for a specific field. |
static java.lang.String |
FACET_FIELD_PREFIX
Value that can be passed to the
addFacetParameter(String, String, String) function to specify the facet prefix for a specific field. |
static int |
KEYWORD_OPERATOR_ACCRUE
A valid value that can be passed to the
setKeywordOperator method. |
static int |
KEYWORD_OPERATOR_AND
A valid value that can be passed to the
setKeywordOperator method. |
static int |
KEYWORD_OPERATOR_MANY
A valid value that can be passed to the
setKeywordOperator method. |
static int |
KEYWORD_OPERATOR_OR
A valid value that can be passed to the
setKeywordOperator method. |
static java.lang.String |
MAX_FACETS
Value that can be passed to the
addFacetParameter(String, String, String) function to specify the maximum number of facets to be returned for a specific field. |
static java.lang.String |
MIN_FACET_COUNT
Value that can be passed to the
addFacetParameter(String, String, String) function to specify the minimum count for a specific field. |
static int |
SEARCHCOMMAND_ACTION_OVERRIDE_ALL
A valid value that can be passed to the
setSearchCommandAction method. |
static int |
SEARCHCOMMAND_ACTION_OVERRIDE_KEYWORDS
A valid value that can be passed to the
setSearchCommandAction method. |
static int |
SUMMARY_ESCAPETAGS
A valid value that can be passed to the
setSummaryAction method. |
static int |
SUMMARY_NOACTION
A valid value that can be passed to the
setSummaryAction method. |
static int |
SUMMARY_REMOVETAGS
A valid value that can be passed to the
setSummaryAction method. |
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSSearchMultiple()
Creates an empty
CSSearchMultiple object. |
CSSearchMultiple(java.lang.String strPropertyFile)
Creates an empty
CSSearchMultiple object, specifying a property file that contains all of the
database connection details. |
Modifier and Type | Method and Description |
---|---|
void |
addFacetDate(java.lang.String date)
Adds a date field to facet on.
|
void |
addFacetField(java.lang.String field)
Adds a field to facet on.
|
void |
addFacetParameter(java.lang.String field,
java.lang.String paramName,
java.lang.String paramValue)
Adds a field-specific faceting parameter.
|
void |
addFacetQuery(java.lang.String query)
Adds a facet query.
|
void |
addFieldConstraint(java.lang.String field,
java.lang.String fieldValue)
Adds a field constraint.
|
void |
addFilterQuery(java.lang.String query)
Adds a filter query to the search.
|
void |
addGroupQuery(java.lang.String strQuery)
Add a group query to the list of group queries to be processed.
|
void |
addSolrParameter(java.lang.String paramName,
java.lang.String paramValue)
Adds an additional Solr parameter to the search.
|
boolean |
equals(java.lang.Object obj)
Check whether or not this
CSItemMultiple is equal to another CSItemMultiple . |
void |
get()
Retrieves search results for all items that match the specified search criteria.
|
int |
getApproxTotalResults()
Gets the approximate number of matches for the search criteria.
|
java.lang.String |
getArticleMetaDataIDs()
Gets the required article metadata.
|
java.lang.String |
getArticleMetaDataOptionalIDs()
Gets the optional article metadata.
|
boolean |
getBoostSearch()
This flag is only applicable when searching a Lucene collection.
|
boolean |
getCaseSensitive()
Deprecated.
This is no longer supported. Using Apache Solr case sensitivity is determined by the field type
definition within the Solr Schema. The default for most fields in the site indexes is to be
case insensitive.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getClusteredIds()
Returns the results of carrying out clustering.
|
java.lang.String |
getClusteringField()
Gets the name of the field that Solr should cluster on, if any.
|
java.lang.String |
getClusteringField(java.lang.String clusteringField)
Deprecated.
use
getClusteringField instead |
int |
getColdFusionVersion()
Deprecated.
|
java.lang.String |
getCollectionNameList()
Gets the list of collection names.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>> |
getDateFacets()
Returns the results of carrying out date faceting, if any.
|
java.lang.String |
getDidYouMean() |
static java.lang.String |
getDisplayDateCriteria()
Gets the criteria that will be used for display date filtering based on the current time/date.
|
boolean |
getEnableDidYouMean() |
java.lang.String |
getFacetDateEnd()
Gets the end date for date faceting.
|
java.lang.String |
getFacetDateGap()
Gets the interval for date faceting.
|
java.util.List<java.lang.String> |
getFacetDates()
Gets the list of date fields to facet on
|
java.lang.String |
getFacetDateStart()
Gets the start date for date faceting.
|
java.lang.String |
getFacetFieldPrefix()
Gets the facet prefix.
|
java.util.List<java.lang.String> |
getFacetFields()
Gets the list of fields to facet on
|
java.util.List<SolrFacetParameter> |
getFacetParameters()
Gets the list of field-specific facet parameters
|
java.util.List<java.lang.String> |
getFacetQueries()
Gets the list of facet queries
|
java.util.List<SolrFieldConstraint> |
getFieldConstraints()
Gets the list of field constraints
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>> |
getFieldFacets()
Returns the results of carrying out field faceting, if any.
|
java.util.List<java.lang.String> |
getFilterQueries()
Gets the list of filter queries
|
java.lang.String |
getGroupField()
Gets the group field.
|
int |
getGroupLimit()
Gets the number of documents to return for each group
|
java.lang.String |
getGroupList()
Gets the list of IDs of the website User Groups to which the specified user belongs.
|
int |
getGroupOffset()
Gets the group offset
|
java.util.List<java.lang.String> |
getGroupQueries()
Gets the list of group queries.
|
boolean |
getGroupTruncate()
Gets the group truncation setting.
|
boolean |
getHighlightingEnabled()
Gets a flag indicating whether or not highlighting is enabled
If highlighting is enabled, the summary field of the search results will
be marked up with highlights around any instances of the supplied search
terms that appear in it
|
java.lang.String |
getKeywordANDOperators()
Gets the additional operators to be accepted as AND operators within the search keywords.
|
java.lang.String |
getKeywordNOTOperators()
Gets the additional operators to be accepted as NOT operators within the search keywords.
|
int |
getKeywordOperator()
Gets the keyword operator to be handled by the
get method in conjunction with the
setKeywords method. |
java.lang.String |
getKeywordOROperators()
Gets the additional operators to be accepted as OR operators within the search keywords.
|
java.lang.String |
getKeywords()
Gets the search keywords.
|
boolean |
getKeywordStemming()
Deprecated.
In Solr stemming is determined by the schema. This setting will be ignored.
|
java.util.Date |
getLastModifiedEndDate() |
java.util.Date |
getLastModifiedStartDate()
Gets the last modified start date.
|
java.lang.String |
getLuceneRepositoryPath()
Gets the path to the Lucene repository.
|
int |
getMaxFacets()
Gets the maximum number of facets that should be retrieved for any field.
|
java.lang.String |
getMediaGroupNames()
Gets the media group names.
|
java.lang.String |
getMediaMetaDataIDs()
Gets the required media metadata.
|
java.lang.String |
getMediaMetaDataOptionalIDs()
Gets the optional media metadata.
|
java.lang.String |
getMediaTypeNames()
Gets the media type names (directories).
|
int |
getMinFacetCount()
Gets the minimum number of results that a facet is required to have.
|
boolean |
getMore()
Gets the flag that indicates whether there are any more matching items to be retrieved.
|
int |
getPort()
Deprecated.
Ignored by Solr implementation
|
java.util.Map<java.lang.String,java.lang.Integer> |
getQueryFacets()
Returns the results of carrying out query faceting, if any.
|
java.lang.String |
getRootArticleIDs()
Gets the article roots.
|
java.lang.String |
getRootForumIDs()
Gets the forum roots.
|
java.lang.String |
getRootMediaGroupIDs()
Gets the media roots.
|
java.lang.String |
getRootProductGroupIDs()
Gets the product group roots.
|
java.lang.String |
getRootProductRackIDs()
Gets the product rack roots.
|
java.lang.String |
getRootThreadIDs()
Gets the forum thread roots.
|
java.lang.String |
getSearchCommand()
Gets the currently specified search command, if any.
|
int |
getSearchCommandAction()
Gets the search command action to be handled by the
get method in conjunction with the
setSearchCommand method. |
int |
getSearchEngineRestartPosition()
Gets index of the first search engine result to be examined for suitability for return to the user.
|
java.lang.String |
getSearchHandler()
Gets the name of the search handler to use.
|
static java.lang.String |
getSecurityCriteria(java.lang.String strPropertyFile,
int nUserId)
Gets the criteria that will be used for security filtering based on the
supplied user ID.
|
java.lang.String |
getServer()
Deprecated.
Ignored by Solr implementation
|
int |
getSolrPageSize()
Gets the number of results to be retrieved from Solr.
|
java.util.List<SolrParameter> |
getSolrParameters()
Gets the list of Solr parameters
|
long |
getSolrResultCount()
Gets the total number of result documents available from the Solr query.
|
int |
getSolrStartPosition()
Gets the start position of the Solr query.
|
int |
getSubsiteID()
Gets the subsite ID.
|
int |
getSummaryAction()
Gets the action to take on any markup in the returned Summary text.
|
int |
getTimeout()
Deprecated.
Ignored by Solr implementation
|
boolean |
getUseLuceneCollections()
Gets the flag that indicates whether we are using Lucene or Solr.
|
java.lang.String |
getUserGroupIDs()
Return the set list of user group ids
|
int |
getUserID()
Gets the website User ID specified as key information.
|
int |
getVerityRestartPosition()
Deprecated.
use getSearchEngineRestartPosition instead
|
int |
hashCode() |
boolean |
isEnhancedSearch()
Deprecated.
|
void |
setApproxTotalResults(int nResults)
Sets the approximate number of matches for the search criteria.
|
void |
setArticleMetaDataIDs(java.lang.String strMetaDataIDs)
Sets the required article metadata.
|
void |
setArticleMetaDataOptionalIDs(java.lang.String strMetaDataIDs)
Sets the optional article metadata.
|
void |
setBoostSearch(boolean bBoostSearch)
This flag is only applicable when searching a Lucene collection.
|
void |
setCaseSensitive(boolean bCaseSensitive)
Deprecated.
This is no longer supported. Using Apache Solr case sensitivity is determined by the field type
definition within the Solr Schema. The default for most fields in the site indexes is to be
case insensitive.
|
void |
setClusteringField(java.lang.String clusteringField)
Sets the name of the field that Solr should cluster on, if any.
|
void |
setColdFusionVersion(int nColdFusionVersion)
Deprecated.
|
void |
setCollectionNameList(java.lang.String strCollectionNameList)
Sets the list of collection names.
|
void |
setEnableDidYouMean(boolean dym) |
void |
setFacetDateEnd(java.lang.String facetDateEnd)
Sets the end date for date faceting.
|
void |
setFacetDateGap(java.lang.String facetDateGap)
Sets the interval for date faceting.
|
void |
setFacetDates(java.util.List<java.lang.String> dateList)
Sets the list of date fields to facet on to the supplied value
|
void |
setFacetDateStart(java.lang.String facetDateStart)
Sets the start date for date faceting.
|
void |
setFacetFieldPrefix(java.lang.String facetFieldPrefix)
Sets the facet field prefix.
|
void |
setFacetFields(java.util.List<java.lang.String> fieldList)
Sets the list of facet fields to the supplied value
|
void |
setFacetParameters(java.util.List<SolrFacetParameter> paramList)
Sets the list of field-specific facet parameters to the supplied value
|
void |
setFacetQueries(java.util.List<java.lang.String> queryList)
Sets the list of facet queries to the supplied value
|
void |
setFieldConstraints(java.util.List<SolrFieldConstraint> fieldConstraints)
Sets the list of field constraints to the supplied value
|
void |
setFilterQueries(java.util.List<java.lang.String> queryList)
Sets the list of filter queries to the supplied value
|
void |
setGroupField(java.lang.String value)
Sets the group field.
|
void |
setGroupLimit(int value)
Sets the number of documents to return for each group
|
void |
setGroupList(java.lang.String strGroupList)
Sets a list of the IDs of the User Groups to which the specified user belongs.
|
void |
setGroupOffset(int value)
Sets the group offset
|
void |
setGroupQueries(java.util.List<java.lang.String> queryList)
Sets the list of group queries to the supplied value.
|
void |
setGroupTruncate(boolean value)
Sets the group truncation setting.
|
void |
setHighlightingEnabled(boolean value)
Sets a flag indicating whether or not highlighting is enabled.
|
void |
setKeywordANDOperators(java.lang.String strOperators)
Sets the additional operators to be accepted as AND operators within the search keywords.
|
void |
setKeywordNOTOperators(java.lang.String strOperators)
Sets the additional operators to be accepted as NOT operators within the search keywords.
|
void |
setKeywordOperator(int nKeywordOperator)
Sets the keyword operator to be handled by the
get method in conjunction with the
setKeywords method. |
void |
setKeywordOROperators(java.lang.String strOperators)
Sets the additional operators to be accepted as OR operators within the search keywords.
|
void |
setKeywords(java.lang.String strKeywords)
Sets the search keywords.
|
void |
setKeywordStemming(boolean bStemming)
Deprecated.
In Solr stemming is determined by the schema. This setting will be ignored.
|
void |
setLastModifiedEndDate(java.util.Date lastModifiedEndDate) |
void |
setLastModifiedStartDate(java.util.Date objLastModifiedStartDate)
Sets the last modified start date.
|
void |
setLuceneRepositoryPath(java.lang.String luceneRepositoryPath)
Sets the path to the Lucene repository.
|
void |
setMaxFacets(int maxFacets)
Sets the maximum number of facets that should be retrieved for any field.
|
void |
setMediaGroupNames(java.lang.String strMediaGroupNames)
Sets the media group names.
|
void |
setMediaMetaDataIDs(java.lang.String strMetaDataIDs)
Sets the required media metadata.
|
void |
setMediaMetaDataOptionalIDs(java.lang.String strMetaDataIDs)
Sets the optional media metadata.
|
void |
setMediaTypeNames(java.lang.String strMediaTypeNames)
Sets the media type names (directories).
|
void |
setMinFacetCount(int minFacetCount)
Sets the minimum number of results that a facet is required to have.
|
void |
setMore(boolean bMore)
Sets the flag that is used to determine whether there are any more matching items to be retrieved.
|
void |
setPort(int nPort)
Deprecated.
Ignored by Solr implementation
|
void |
setRootArticleIDs(java.lang.String strRootArticleIDs)
Sets the article roots.
|
void |
setRootForumIDs(java.lang.String strRootForumIDs)
Sets the forum roots.
|
void |
setRootMediaGroupIDs(java.lang.String strRootMediaGroupIDs)
Sets the media roots.
|
void |
setRootProductGroupIDs(java.lang.String strRootProductGroupIDs)
Sets the product group roots.
|
void |
setRootProductRackIDs(java.lang.String strRootProductRackIDs)
Sets the product rack roots.
|
void |
setRootThreadIDs(java.lang.String strRootThreadIDs)
Sets the forum thread roots.
|
void |
setSearchCommand(java.lang.String strSearchCommand)
Sets the search command.
|
void |
setSearchCommandAction(int nSearchCommandAction)
Sets the search command action to be handled by the
get method in conjunction with the
setSearchCommand method. |
void |
setSearchEngineRestartPosition(int nPos)
Sets index of the first search engine result to be examined for suitability for return to the user.
|
void |
setSearchHandler(java.lang.String value)
Sets the name of the search handler to use.
|
void |
setServer(java.lang.String strServer)
Deprecated.
Ignored by Solr implementation
|
void |
setSolrPageSize(int nSolrPageSize)
Sets the number of results to be retrieved from Solr.
|
void |
setSolrParameters(java.util.List<SolrParameter> parameterList)
Sets the list of Solr parameters to the supplied value
|
void |
setSolrResultCount(long nSolrResultCount)
Sets the total number of result documents available from the Solr query.
|
void |
setSolrStartPosition(int nSolrStartPosition)
Sets the start position of the Solr query.
|
void |
setStartRow(int nStartRow)
Sets the first row of the query result set that should be accessed when the
get method is
executed. |
void |
setSubsiteID(int nSubsiteID)
Sets the subsite ID.
|
void |
setSummaryAction(int nSummaryAction)
Sets the action to take on any markup in the returned Summary text.
|
void |
setTimeout(int nTimeout)
Deprecated.
Ignored by Solr implementation
|
void |
setUseLuceneCollections(boolean bUseLuceneCollections)
Sets the flag that is used to determine whether we are using Lucene or Solr.
|
void |
setUserGroupIDs(java.lang.String groupIDs)
Sets the group ids to return users under users found to be a child of one the provided groups
will be returned
|
void |
setUserID(int nUserID)
Sets the website User ID to be used as key information.
|
void |
setVerityRestartPosition(int nPos)
Deprecated.
use setSearchEngineRestartPosition instead
|
java.lang.String |
toString()
Output the contents of this
CSSearchMultiple object to a String object in a
user-friendly format. |
delete, exist, getItems, getMaxRows, getSortOrder, getStartRow, iterator, setItems, setMaxRows, setSortOrder, update
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setDetailLevel, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public static final int SEARCHCOMMAND_ACTION_OVERRIDE_ALL
setSearchCommandAction
method.
SEARCHCOMMAND_ACTION_OVERRIDE_ALL
indicates that any other methods provided to restrict the
search, shall be ignored. This is the default setting.public static final int SEARCHCOMMAND_ACTION_OVERRIDE_KEYWORDS
setSearchCommandAction
method.
SEARCHCOMMAND_ACTION_OVERRIDE_KEYWORDS
indicates that any other methods may be provided to further
restrict the search, with the exception of the search keywords.public static final int KEYWORD_OPERATOR_ACCRUE
setKeywordOperator
method.
KEYWORD_OPERATOR_ACCRUE
indicates that the search keywords will have 'ACCRUE' inserted in between
each search keyword. An ACCRUE operator will select items that contain at least one of the search keywords that
you specify. Items are ranked based on the number of search keywords found. This is the default setting.public static final int KEYWORD_OPERATOR_OR
setKeywordOperator
method.
KEYWORD_OPERATOR_ANY
indicates that the search keywords will have 'OR' inserted in between each
search keyword that currently does not have an operator as a separator. An 'OR' operator will select items that
contain at least one of the search keywords that you specify.public static final int KEYWORD_OPERATOR_AND
setKeywordOperator
method.
KEYWORD_OPERATOR_ALL
indicates that the search keywords will have 'AND' inserted in between each
search keyword that currently does not have an operator as a separator. An 'AND' operator will select items that
contain all of the search keywords that you specify.public static final int KEYWORD_OPERATOR_MANY
setKeywordOperator
method.
KEYWORD_OPERATOR_MANY
indicates that the search keywords will be converted to a comma-seperated
list, be wrapped in '(' and ')' brackets and have 'MANY' prepended. If another operator is found in the keywords
list it will be removed since mixing these and <MANY> is not legal Solr Query Language syntax. A 'MANY'
operator will select items that contain at least one of the specified keywords and ranks items based on the
density of keywords found.public static final int SUMMARY_NOACTION
setSummaryAction
method.
SUMMARY_NOACTION
indicates that the Summary will be left untouched.public static final int SUMMARY_REMOVETAGS
setSummaryAction
method.
SUMMARY_REMOVETAGS
indicates that all tags will be stripped from the Summary.public static final int SUMMARY_ESCAPETAGS
setSummaryAction
method.
SUMMARY_REMOVETAGS
indicates that angle-brackets and quotes will be converted into HTML escape
sequences, allowing the Summary to display correctly within an HTML page.public static final java.lang.String FACET_DATE_END
addFacetParameter(String, String, String)
function to specify the end of the facet date range for a specific field.public static final java.lang.String FACET_DATE_GAP
addFacetParameter(String, String, String)
function to specify the facet date gap for a specific field.public static final java.lang.String FACET_DATE_START
addFacetParameter(String, String, String)
function to specify the start of the facet date range for a specific field.public static final java.lang.String FACET_FIELD_PREFIX
addFacetParameter(String, String, String)
function to specify the facet prefix for a specific field.
Only facet values beginning with this prefix will be returned.public static final java.lang.String MAX_FACETS
addFacetParameter(String, String, String)
function to specify the maximum number of facets to be returned for a specific field.public static final java.lang.String MIN_FACET_COUNT
addFacetParameter(String, String, String)
function to specify the minimum count for a specific field.
For example if this value is set to "1" only facets with a count of at least 1 will be returned.public CSSearchMultiple()
CSSearchMultiple
object.
Use the various set
methods to initialise the CSSearchMultiple
object prior to
invoking get()
.
public CSSearchMultiple(java.lang.String strPropertyFile)
CSSearchMultiple
object, specifying a property file that contains all of the
database connection details.
Use the various set
methods to initialise the CSSearchMultiple
object prior to
invoking get()
.
strPropertyFile
- the name of the property file from which the database connection details are to be read.@Deprecated public boolean isEnhancedSearch()
public java.lang.String getSearchHandler()
public void setSearchHandler(java.lang.String value)
value
- the search handler name.public void addFacetField(java.lang.String field)
field
- the facet field to be added.public void setFacetFields(java.util.List<java.lang.String> fieldList)
fieldList
- the list of fields to facet onpublic java.util.List<java.lang.String> getFacetFields()
public void addFacetParameter(java.lang.String field, java.lang.String paramName, java.lang.String paramValue)
CSSearchMultiple.FACET_DATE_END
,
CSSearchMultiple.FACET_DATE_START
,
CSSearchMultiple.FACET_DATE_GAP
,
CSSearchMultiple.FACET_FIELD_PREFIX
,
CSSearchMultiple.MAX_FACETS
and
CSSearchMultiple.MIN_FACET_COUNT
are defined for
convenience. Call this function repeatedly to add multiple parameters.field
- the facet field to specify the parameter forparamName
- the parameter nameparamValue
- the parameter valuepublic void setFacetParameters(java.util.List<SolrFacetParameter> paramList)
paramList
- the list of field-specific facet parameterspublic java.util.List<SolrFacetParameter> getFacetParameters()
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>> getFieldFacets()
Map
that maps each facet field name to a Map
that maps facet values to facet counts.public void addFacetDate(java.lang.String date)
date
- the facet date field to be added.public void setFacetDates(java.util.List<java.lang.String> dateList)
dateList
- the list of date fields to facet onpublic java.util.List<java.lang.String> getFacetDates()
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>> getDateFacets()
Map
that maps each facet date field to a Map that maps facet values to facet counts.public void addFacetQuery(java.lang.String query)
query
- the query to be added.public void setFacetQueries(java.util.List<java.lang.String> queryList)
queryList
- the list of facet queriespublic java.util.List<java.lang.String> getFacetQueries()
public java.util.Map<java.lang.String,java.lang.Integer> getQueryFacets()
Map
that maps each facet query to a count of the results matching that query.public boolean getHighlightingEnabled()
If highlighting is enabled, the summary field of the search results will be marked up with highlights around any instances of the supplied search terms that appear in it
public void setHighlightingEnabled(boolean value)
If highlighting is enabled, the summary field of the search results will be marked up with highlights around any instances of the supplied search terms that appear in it
value
- the highlighting flagpublic void setClusteringField(java.lang.String clusteringField)
Call getClusteredIds
after performing a search with a ClusteringField specified to
retrieve the clustered results.
clusteringField
- the name of a field that Solr should use for clustering@Deprecated public java.lang.String getClusteringField(java.lang.String clusteringField)
getClusteringField
instead
Call getClusteredIds
after performing a search with a ClusteringField specified to
retrieve the clustered results.
public java.lang.String getClusteringField()
Call getClusteredIds
after performing a search with a ClusteringField specified to
retrieve the clustered results.
public final java.util.Map<java.lang.String,java.util.List<java.lang.String>> getClusteredIds()
Map
that maps each cluster label to a list of document IDs matching that cluster.public void setMaxFacets(int maxFacets)
maxFacets
- the maximum number of facets to be retrieved.public int getMaxFacets()
public void setMinFacetCount(int minFacetCount)
minFacetCount
- the minimum number of results per facetpublic int getMinFacetCount()
public void setFacetFieldPrefix(java.lang.String facetFieldPrefix)
facetFieldPrefix
- the facet field prefix.public java.lang.String getFacetFieldPrefix()
public void setFacetDateStart(java.lang.String facetDateStart)
facetDateStart
- the facet start date.public java.lang.String getFacetDateStart()
public void setFacetDateEnd(java.lang.String facetDateEnd)
facetDateEnd
- the facet end date.public java.lang.String getFacetDateEnd()
public void setFacetDateGap(java.lang.String facetDateGap)
This property specifies the interval to be used for faceting on the specified date fields, which is given using DateMathParser syntax). The default is "+1MONTH", an interval of 1 month.
facetDateGap
- the facet end date.public java.lang.String getFacetDateGap()
This property specifies the interval to be used for faceting on the specified date fields, which is given using DateMathParser syntax). The default is "+1MONTH", an interval of 1 month.
public java.lang.String getGroupField()
public void setGroupField(java.lang.String value)
value
- the group fieldpublic void addGroupQuery(java.lang.String strQuery)
strQuery
- Query stringpublic void setGroupQueries(java.util.List<java.lang.String> queryList)
queryList
- the list of group queriespublic java.util.List<java.lang.String> getGroupQueries()
public int getGroupLimit()
public void setGroupLimit(int value)
value
- the group limitpublic int getGroupOffset()
public void setGroupOffset(int value)
value
- the group offsetpublic boolean getGroupTruncate()
public void setGroupTruncate(boolean value)
value
- the group truncation settingpublic void addSolrParameter(java.lang.String paramName, java.lang.String paramValue)
paramName
- the name of the parameter to addparamValue
- the value of the parameter to addpublic void setSolrParameters(java.util.List<SolrParameter> parameterList)
parameterList
- the list of Solr parameterspublic java.util.List<SolrParameter> getSolrParameters()
public void addFilterQuery(java.lang.String query)
query
- the filter query to add e.g. "facetfield:facetvalue"public void setFilterQueries(java.util.List<java.lang.String> queryList)
queryList
- the list of filter queries to addpublic java.util.List<java.lang.String> getFilterQueries()
public void addFieldConstraint(java.lang.String field, java.lang.String fieldValue)
field
- the field the constraint applies to e.g. "OBJECT_SF_PLACES".fieldValue
- the value the field must match to be included in the results e.g. "Plymouth".public void setFieldConstraints(java.util.List<SolrFieldConstraint> fieldConstraints)
fieldConstraints
- the list of field constraintspublic java.util.List<SolrFieldConstraint> getFieldConstraints()
public java.lang.String getDidYouMean()
public void setEnableDidYouMean(boolean dym)
public boolean getEnableDidYouMean()
public void setKeywordStemming(boolean bStemming)
public boolean getKeywordStemming()
public void setCaseSensitive(boolean bCaseSensitive)
bCaseSensitive
- true
to make search case-sensitive, false
to make it case-insensitivepublic boolean getCaseSensitive()
true
if the search is case-sensitive, false
if case-insensitivepublic void setBoostSearch(boolean bBoostSearch)
true
then the search will account for boosted
keywords. If the search criteria match the keywords field in the returned content then these matched items will
appear at the top of the result set. If the flag is set to false
then the boosted keywords will be
ignored. The default is true
.
bBoostSearch
- a boolean (true or false)public boolean getBoostSearch()
public void setMore(boolean bMore)
setMaxRows
method is used.
bMore
- a boolean (true or false)public boolean getMore()
setMaxRows
method is used.
public void setSearchEngineRestartPosition(int nPos)
get
method is invoked on the object. Successive calls to the get
on the same object
will keep the SearchEngineRestartPosition
and the StartRow
properties
appropriately synchronised but these methods will need to be invoked manually if particular starting conditions
are required on a new CSSearchMultiple
object.
nPos
- a positive integer, greater than or equal to onepublic int getSearchEngineRestartPosition()
get
method is invoked on the object. Successive calls to the get
on the same object
will keep the SearchEngineRestartPosition
and the StartRow
properties
appropriately synchronised.
@Deprecated public void setVerityRestartPosition(int nPos)
get
method is invoked on the object. Successive calls to the get
on the same object
will keep the VerityRestartPosition
and the StartRow
properties
appropriately synchronised but these methods will need to be invoked manually if particular starting conditions
are required on a new CSSearchMultiple
object.
nPos
- a positive integer, greater than or equal to one@Deprecated public int getVerityRestartPosition()
get
method is invoked on the object. Successive calls to the get
on the same object
will keep the VerityRestartPosition
and the StartRow
properties
appropriately synchronised.
public void setApproxTotalResults(int nResults)
getVerityRestartPosition
returns 1. It remains set while the search object is
re-used to obtain further batches of results in subsequent calls to the get
method. The value is
approximate as it does not account for the on/off state or any restricted access to the content identified by the
search results, although only accessible content will be returned in the search results.
nResults
- a positive integer, representing the approximate number of matching resultspublic int getApproxTotalResults()
getVerityRestartPosition
returns 1. It remains set while the search object is
re-used to obtain further batches of results in subsequent calls to the get
method. The value is
approximate as it does not account for the on/off state or any restricted access to the content identified by the
search results, although only accessible content will be returned in the search results.
public void setSolrResultCount(long nSolrResultCount)
nSolrResultCount
- A postitive long integer indicating the number of results available from the querypublic long getSolrResultCount()
public void setSolrStartPosition(int nSolrStartPosition)
nSolrStartPosition
- A positive integer that sets the Solr query start position.public int getSolrStartPosition()
public void setSolrPageSize(int nSolrPageSize)
nSolrPageSize
- A positive integer that sets the Solr page size.public int getSolrPageSize()
public void setSearchCommand(java.lang.String strSearchCommand)
The search can be restricted by the type of action supplied via the
setSearchCommandAction
method.
The search is case-insensitive by default meaning that a keyword of 'Film' will match against 'film', 'Film' and
'FILM'. The search can be made case-sensitive via the setCaseSensitive
method
if required. When conducting a case-sensitive search, any mixed case keywords will search for an exact match in
case, for example 'Film' will only match 'Film'. Importantly, Solr will always treat lower-cased and
upper-cased keywords as a case-insenitive search and will therefore match against any case. Note that
double-quoted phrases will always be case-insensitive.
strSearchCommand
- a String
containing the custom search criteria.public java.lang.String getSearchCommand()
The search can be restricted by the type of action supplied via the
setSearchCommandAction
method.
String
containing the search command.public void setSearchCommandAction(int nSearchCommandAction) throws CSParameterException
get
method in conjunction with the
setSearchCommand
method.
The valid search command actions are :
SEARCHCOMMAND_ACTION_OVERRIDE_ALL
- Default search command action. This will override all search
restriction settings and keywords that may have been setup, for example, content root IDs, media group names and
keywords.
SEARCHCOMMAND_ACTION_OVERRIDE_KEYWORDS
- This will override only the keywords that may have been
setup.nSearchCommandAction
- One of the predefined search command action values.CSParameterException
- if an invalid search command action is specified.public int getSearchCommandAction()
get
method in conjunction with the
setSearchCommand
method.
Refer to the setSearchCommandAction
method for more information on actions
and their usage.
public void setServer(java.lang.String strServer)
public java.lang.String getServer()
public void setPort(int nPort)
public int getPort()
public void setTimeout(int nTimeout)
public int getTimeout()
public void setKeywords(java.lang.String strKeywords)
get
method
is invoked.
The type of search undertaken for the supplied keywords will depend on the type of operator supplied via the
setKeywordOperator
method.
To search for a particular phrase, wrap the words making up the phrase within quotation marks to form a single keyword.
No other Solr operators may be used with these keywords. The following characters that have special meaning to
Solr will therefore be escaped unless within a double-quoted phrase :
(),[=<>!'@`{
Use the
setSearchCommand
method to perform more complex searches using the full set of
Solr operators and modifiers.
SAMPLE KEYWORDS
KEYWORDS | RESULTING SEARCH |
---|---|
low brass instrument | low ACCRUE brass ACCRUE instrument |
low OR brass OR instrument | low OR brass OR instrument |
film | If stemming is enabled : film, films, filming, or filmed If stemming is disabled : film |
"film" | If stemming is enabled : film If stemming is disabled : film |
"low brass instrument" | The phrase 'low brass instrument' |
filming AND fun | If stemming is enabled : film, films, filming, or filmed, AND fun If stemming is disabled : filming AND fun |
filming NOT fun | If stemming is enabled : film, films, filming, or filmed, NOT fun If stemming is disabled : filming NOT fun |
strKeywords
- a String
containing Solr search keywords.public java.lang.String getKeywords()
get
method.
Refer to the setKeywords
method for more information on keywords and their usage.
String
containing Solr search keywords.public void setKeywordOperator(int nKeywordOperator) throws CSParameterException
get
method in conjunction with the
setKeywords
method.
The valid keyword operators are :
KEYWORD_OPERATOR_ACCRUE
- Default keyword operator. This will insert the Solr 'ACCRUE' operator
in between keywords that are not currently separated by any operator.KEYWORD_OPERATOR_OR
- This will insert the Solr 'OR' operator in between keywords that are not
currently separated by any operator.KEYWORD_OPERATOR_AND
- This will insert the Solr 'AND' operator in between keywords that are not
currently separated by any operator.KEYWORD_OPERATOR_MANY
- This will prepend the Solr 'MANY' operator to the keywords.nKeywordOperator
- One of the predefined keyword operators.CSParameterException
- if an invalid keyword operator is specified.public int getKeywordOperator()
get
method in conjunction with the
setKeywords
method.
Refer to the setKeywordOperator
method for more information on operators and
their usage.
public void setKeywordANDOperators(java.lang.String strOperators)
setKeywords
search, the 'AND' operator is always accepted. Operators should be
delimited by a space. For example, supplying '& +' as the operator list will result in & and + also being treated
as an 'AND' operator provided they do not fall within double-quotes.
strOperators
- a String
containing the list of operators.public java.lang.String getKeywordANDOperators()
setKeywords
, the 'AND' operator is always accepted. Operators will be delimited by
a space. For example, supplying '& +' as the operator list will result in & and + also being treated as an 'AND'
operator provided they do not fall within double-quotes.
String
containing the list of operators.public void setKeywordOROperators(java.lang.String strOperators)
setKeywords
, the 'OR' operator is always accepted. Operators should be delimited by
a space. For example, supplying ', |' as the operator list will result in , and | also being treated as an 'OR'
operator provided they do not fall within double-quotes.
strOperators
- a String
containing the list of operators.public java.lang.String getKeywordOROperators()
setKeywords
, the 'OR' operator is always accepted. Operators should be delimited by
a space. For example, supplying ', |' as the operator list will result in , and | also being treated as an 'OR'
operator provided they do not fall within double-quotes.
String
containing the list of operators.public void setKeywordNOTOperators(java.lang.String strOperators)
setKeywords
, the 'NOT' operator is always accepted. Operators should be delimited
by a space. For example, supplying '- !' as the operator list will result in - and ! also being treated as an
'NOT' operator provided they do not fall within double-quotes.
strOperators
- a String
containing the list of operators.public java.lang.String getKeywordNOTOperators()
setKeywords
, the 'NOT' operator is always accepted. Operators will be delimited by
a space. For example, supplying '- !' as the operator list will result in - and ! also being treated as an 'NOT'
operator provided they do not fall within double-quotes.
String
containing the list of operators.public void setCollectionNameList(java.lang.String strCollectionNameList)
get
method.
strCollectionNameList
- a String
containing a comma-delimited list of Solr collection name(s).public java.lang.String getCollectionNameList()
get
method.
String
containing a comma-delimited list of Solr collection name(s).public void setLastModifiedStartDate(java.util.Date objLastModifiedStartDate)
get
method. Note that this method will be ignored for custom collections.
objLastModifiedStartDate
- the last modified start date.public java.util.Date getLastModifiedStartDate()
get
method.
public java.util.Date getLastModifiedEndDate()
public void setLastModifiedEndDate(java.util.Date lastModifiedEndDate)
lastModifiedEndDate
- the m_objLastModifiedEndDate to setpublic void setSubsiteID(int nSubsiteID)
get
method. Setting the
subsite ID provides a quick method of setting the appropriate root ID's when restricting the search to the
contents of a particular subsite. Note that if setRootArticleIDs
and/or
setRootMediaGroupIDs
are used concurrently with setSubsiteID
,
the subsite roots will be overridden by the explicitly specified roots.
nSubsiteID
- the ID of the subsite to be searched.public int getSubsiteID()
get
method. Note that
if setRootArticleIDs
and/or
setRootMediaGroupIDs
have been used concurrently with
setSubsiteID
, the subsite roots will be overridden by the explicitly specified roots.
public void setArticleMetaDataIDs(java.lang.String strMetaDataIDs)
strMetaDataIDs
- a String
containing a comma-delimited list of metadata value IDs.public java.lang.String getArticleMetaDataIDs()
String
containing a comma-delimited list of metadata value IDs.public void setArticleMetaDataOptionalIDs(java.lang.String strMetaDataIDs)
strMetaDataIDs
- a String
containing a comma-delimited list of metadata value IDs.public java.lang.String getArticleMetaDataOptionalIDs()
String
containing a comma-delimited list of metadata value IDs.public void setRootArticleIDs(java.lang.String strRootArticleIDs)
get
method. Only the supplied roots and their children will be searched.
strRootArticleIDs
- a String
containing a comma-delimited list of root article IDs.public java.lang.String getRootArticleIDs()
get
method. Only the supplied roots and their children will be searched.
String
containing a comma-delimited list of root article IDs.public void setRootMediaGroupIDs(java.lang.String strRootMediaGroupIDs)
get
method. Only the media located within the specified branches will be searched.
strRootMediaGroupIDs
- a String
containing a comma-delimited list of root media group IDs.public java.lang.String getRootMediaGroupIDs()
get
method. Only the media located within the specified branches will be searched.
String
containing a comma-delimited list of root media group IDs.public void setMediaGroupNames(java.lang.String strMediaGroupNames)
get
method.
Only media within the supplied groups will be searched.
strMediaGroupNames
- a String
containing a comma-delimited list of media group names.public java.lang.String getMediaGroupNames()
get
method.
Only media within the supplied groups will be searched.
String
containing a comma-delimited list of media group names.public void setMediaTypeNames(java.lang.String strMediaTypeNames)
get
method. Only media of the supplied types will be searched. NOTE This should be a list of media
type names and not descriptions, contrary to the deprecated CSCollectionMediaMultiple
object.
strMediaTypeNames
- a String
containing a comma-delimited list of media type names.public java.lang.String getMediaTypeNames()
get
method. Only media of the supplied types will be searched.
String
containing a comma-delimited list of media type names.public void setMediaMetaDataIDs(java.lang.String strMetaDataIDs)
strMetaDataIDs
- a String
containing a comma-delimited list of metadata value IDs.public java.lang.String getMediaMetaDataIDs()
String
containing a comma-delimited list of metadata value IDs.public void setMediaMetaDataOptionalIDs(java.lang.String strMetaDataIDs)
strMetaDataIDs
- a String
containing a comma-delimited list of metadata value IDs.public java.lang.String getMediaMetaDataOptionalIDs()
String
containing a comma-delimited list of metadata value IDs.public void setUserGroupIDs(java.lang.String groupIDs)
groupIDs
- a String
containing a comma-delimited list of group value IDs.public java.lang.String getUserGroupIDs()
String
containing a comma-delimited list of group IDs.public void setRootForumIDs(java.lang.String strRootForumIDs)
get
method. Only messages within the supplied forums will be searched.
strRootForumIDs
- a String
containing a comma-delimited list of forum IDs.public java.lang.String getRootForumIDs()
get
method. Only messages within the supplied forums will be searched.
String
containing a comma-delimited list of forum IDs.public void setRootThreadIDs(java.lang.String strRootThreadIDs)
get
method. Only messages within the supplied threads will be searched.
strRootThreadIDs
- a String
containing a comma-delimited list of thread IDs.public java.lang.String getRootThreadIDs()
get
method. Only messages within the supplied threads will be searched.
String
containing a comma-delimited list of thread IDs.public void setRootProductGroupIDs(java.lang.String strRootProductGroupIDs)
get
method. Only the product types located within the specified branches will be searched.
strRootProductGroupIDs
- a String
containing a comma-delimited list of root product group IDs.public java.lang.String getRootProductGroupIDs()
get
method. Only the product types located within the specified branches will be searched.
String
containing a comma-delimited list of root product group IDs.public void setRootProductRackIDs(java.lang.String strRootProductRackIDs)
get
method. Only the product types located within the specified racks will be searched.
strRootProductRackIDs
- a String
containing a comma-delimited list of root product rack IDs.public java.lang.String getRootProductRackIDs()
get
method. Only the product types located within the specified racks will be searched.
String
containing a comma-delimited list of root product rack IDs.public void setUserID(int nUserID)
Do not set User ID if you are only interested in retrieving unsecured articles, as this will result in a faster
query.
setUserID
and an appropriate set
method for article ID followed by a call to
get
will return details of the articles which are either unsecured articles, or secured articles
to which the specified has access.
nUserID
- the ID of the user to be used in article security checks.public int getUserID()
public void setGroupList(java.lang.String strGroupList)
Do not set this list unless User ID is also being specified using the setUserID
method.
Specifying the website User ID is sufficient to enable full article security to be implemented. However, for
performance reasons the list of group IDs should be also specified if it is already known.
strGroupList
- comma-separated list of the IDs of the website user groups to which the specified user belongs.public java.lang.String getGroupList()
This list is built up by the get
method only if a User ID is specified using the
setUserID
method.
public void setStartRow(int nStartRow) throws CSParameterException
get
method is
executed. This can be used in conjunction with setMaxRows
to define a batch of results
to get during the get()
method. The default is 1.
setStartRow
in class CSItemMultiple
nStartRow
- a positive integer index of the first row which is to be retrieved by get()
. The first
row is numbered 1 the second 2 and so on.CSParameterException
- if an invalid start row was specifiedpublic void setSummaryAction(int nSummaryAction) throws CSParameterException
Valid actions are :
SUMMARY_NOACTION
Leave Summary untouched.
SUMMARY_REMOVETAGS
Strips all tags from the Summary.
SUMMARY_ESCAPETAGS
Converts angle-brackets and quotes into HTML escape sequences, allowing
the Summary to display correctly within an HTML page.
nSummaryAction
- an integer specifying one of the pre-defined summary actions.CSParameterException
- if an invalid summary action is specified.public int getSummaryAction()
Valid actions are :
SUMMARY_NOACTION
Leave Summary untouched.
SUMMARY_REMOVETAGS
Strips all tags from the Summary.
SUMMARY_ESCAPETAGS
Converts angle-brackets and quotes into HTML escape sequences, allowing
the Summary to display correctly within an HTML page.
public void setUseLuceneCollections(boolean bUseLuceneCollections)
bUseLuceneCollections
- a boolean (true or false)public boolean getUseLuceneCollections()
@Deprecated public void setColdFusionVersion(int nColdFusionVersion)
nColdFusionVersion
- The version of ColdFusion.@Deprecated public int getColdFusionVersion()
public void setLuceneRepositoryPath(java.lang.String luceneRepositoryPath)
luceneRepositoryPath
- Path to the Lucene repository.public java.lang.String getLuceneRepositoryPath()
public void get() throws CSException
Use the setServer
, setPort
,
setKeywords
, setKeywordOperator
and
setCollectionNameList
methods to supply the required search criteria
before invoking this get
method. Use the various setRootXxxxxIDs
,
setSubsiteID
, and
setLastModifiedStartDate
method to restrict the search. When
searching media, the setMediaGroupNames
and/or
setMediaTypeNames
methods may also be used to restrict the search to
particular media groups/types. When searching articles, the
setArticleMetaDataIDs
and
setArticleMetaDataOptionalIDs
methods may be used to restrict the
search the search to articles with particular combinations of related metadata.
Case sensitivity and keyword stemming can be enabled/disabled by using the
setCaseSensitive
and setKeywordStemming
methods.
To override the above default behaviour, use setSearchCommand
instead of
setKeywords
to specify a search command that is to be passed directly to Solr. In this case, any
other information supplied via the setRootXxxxxIDs
, setSubsiteID
,
setMediaGroupNames
and setMediaTypeNames
methods will be ignored. The search
command behaviour is controlled by the setSearchCommandAction
method.
To allow access to secured items, use the setUserID
and optionally the
setGroupList
methods to supply the current user's details.
Each retrieved item will be stored as a CSSearchItem
object within the item ArrayList
member of CSSearchMultiple
- use getItems
or iterator
to
access/navigate through them. The items will be stored in the ArrayList
in descending score order
i.e. the items that match the keywords most closely will be found first in the item ArrayList
.
For an article the Custom1
field of the CSSearchItem
contains the article's parent
ID list, the Custom2
field contains the related metadata ID list and the Custom3
field
contains the template ID.
For a media item, the Custom1
field of the CSSearchItem
contains a list of parent
group IDs and the Custom2
field contains the media group's name and media type's ID separated by a
comma. For an indexed file associated with a media item, the Custom1
field contains 'MediaFile',
the Custom2
field contains the ID of the associated media item, and the Custom3
field
contains media group's name and media type's ID.
For a forum message, the Custom1
field of the CSSearchItem
contains the parent
thread's ID and the Custom2
field contains the parent forum's ID.
For a product type, the Custom1
field of the CSSearchItem
contains a list of parent
group IDs and the Custom2
field contains a list of parent rack IDs.
get
in class CSItemMultiple
CSException
- for many reasons, usually one of:
public static java.lang.String getDisplayDateCriteria()
In the event that it is necessary for an API client to access Solr
directly (bypassing CSSearchMultiple) this function and the
getSecurityCriteria(String, int)
function can be
used to generate filter queries that enable the client to reproduce the
same display date and security filtering behaviour as CSSearchMultiple
searches.
public static java.lang.String getSecurityCriteria(java.lang.String strPropertyFile, int nUserId) throws CSException
In the event that it is necessary for an API client to access Solr
directly (bypassing CSSearchMultiple) this function and the
getDisplayDateCriteria
function can be
used to generate filter queries that enable the client to reproduce the
same display date and security filtering behaviour as CSSearchMultiple
searches.
strPropertyFile
- Property filenUserId
- User idCSException
- CSExceptionpublic java.lang.String toString()
CSSearchMultiple
object to a String
object in a
user-friendly format.
toString
in class CSItemMultiple
String
containing the user-friendly output.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
CSItemMultiple
CSItemMultiple
is equal to another CSItemMultiple
. The
item data (CSItemContent
derived component) of each CSItem
derived object stored within this
CSItemMultiple instance must be equal in order to be deemed equal. Key information and anything that falls
outside of the CSItemContent
data is not compared. Note that the key data used for searching is
not tested for equality.
equals
in class CSItemMultiple
obj
- the object with which to compare this CSItemMultiple
.obj
.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.