The CSSearchMultiple class searches an iCM, site, or custom search collection for the specified search terms or keywords.
This documentation describes the methods and properties available to use via the API Server's iCMAPI Worker. If you are working directly with the iCM.NET or iCM4j APIs, consult the documentation for your framework. The main difference being the various add methods available in the standard APIs, whereas the iCMAPI Worker requires everything to be done via the properties of the get request.
The following search collections are maintained by iCM. For more information about how the items in each collection are indexed see the Search Indexing article.
The Advanced Searching with CSSearchMultiple knowledge base articles include example forms that demonstrate faceting, grouping and location based searches. They use filter queries, group queries, SOLR functions as search commands, and show how additional SOLR parameters can be included in your requests.
Collection | Description | Instance |
---|---|---|
Article | The articles in iCM | Site and iCM |
Media | Items in the iCM media library | Site and iCM |
Message | Replies to forum threads | Site and iCM |
Metadata | Metadata values in iCM | Site and iCM |
Object | iCM objects | Site and iCM |
Product | Products in the iCM commerce platform | Site and iCM |
PublishedEndpoint | Published End Points | iCM only |
PublishedForm | Published Forms | iCM only |
SiteUser | Website users | Site and iCM |
WIPEndpoint | Work in progress End points | iCM only |
WIPForm | Work in progress forms | iCM only |
For user-defined collections, search results will depend 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.
Methods
CSSearchMultiple_get
Performs the search. Due to the wide range of properties that can be used to restrict/refine the search, they won't all be repeated here, just those that are required are listed, followed by some examples. See the relevant knowledge base articles for more detailed examples.
Request Parameters
Name | Type | Description |
---|---|---|
set.CollectionNameList | String, required | A comma separated list of the collections you'd like to search. Not all collections are available in the solrsite collection (see above). * searches all |
set.LuceneRepositoryPath | String, required | The path to the SOLR collection |
set.Keywords | String | A comma separated list of keywords to search for. The default operator OR is used (can be changed using the KeywordOperator property). Either Keywords or SearchCommand must be set |
set.SearchCommand | String | The search command to pass directly to SOLR. Useful if constructing more complex (eg function) searches. By default ignores other properties that restrict the search (behaviour can be changed using the SearchCommandAction property). Either Keywords or SearchCommand must be set |
get.[property,property] | String | A comma separated list of the properties of CSSearchMultiple you would like to get. * returns all. See below |
Keywords
The
By default stemming is enabled, so a keyword of film will return film, films, filming, etc. Double quotation marks can be used to wrap an individual keyword if stemming is not required in that particular instance. Stemming can be turned off completely by setting the
SearchCommand
The
Example Request - Return All
In this request we are searching the solrsite article collection for any articles with the word Tim in. You need to request all if you want the information in each CSSearchItem to be returned.
client.invoke("icmapi", "CSSearchMultiple_get", {
"set": {
"CollectionNameList": "Article",
"LuceneRepositoryPath": "http://localhost:5506/solrsite",
"Keywords": "Tim"
},
"get": "*"
});
Response Properties
Name | Type | Description |
---|---|---|
data.multipleItemData | Array | An array of CSSearchItems matching the properties of the get request |
data.itemData | Object | The properties of the get request, including faceting results |
Example Response - Return All
Two results have been found.
"result": {
"data": {
"multipleItemData": [{
"ParentData": ",154,1,0",
"CreationDate": "2018-02-14T10:42:19Z",
"_ItemClass": "CSSearchItem",
"GroupKey": "Article154",
"Title": "Tim's Article",
"Url": "",
"Custom3": "1",
"Score": 17.848412,
"Type": "Article",
"Custom2": "",
"Custom1": ",154,1,0",
"ModificationDate": "2018-02-14T10:42:19Z",
"MetaData": "",
"DynamicFields": {
"OBJECT_C__title": "Tim's Article"
},
"Summary": "This is the summary text This is the body text",
"Key": "154"
}, {
"ParentData": ",155,1,0",
"CreationDate": "2018-02-14T10:42:54Z",
"_ItemClass": "CSSearchItem",
"GroupKey": "Article155",
"Title": "Tim's Article with Metadata",
"Url": "",
"Custom3": "1",
"Score": 14.278729,
"Type": "Article",
"Custom2": "1",
"Custom1": ",155,1,0",
"ModificationDate": "2018-02-14T10:42:54Z",
"MetaData": "1",
"DynamicFields": {
"OBJECT_C__title": "Tim's Article with Metadata"
},
"Summary": "This is the summary text This is the body text",
"Key": "155"
}],
"itemData": {
"SearchHandler": "",
"EnableDidYouMean": false,
"KeywordOROperators": "",
"_ItemClass": "CSSearchMultiple",
"Server": null,
"GroupQueries": [],
"GroupField": "",
"Port": 0,
"LuceneRepositoryPath": "http://localhost:5506/solricm",
"GroupTruncate": false,
"RootArticleIDs": "",
"FacetDateStart": "NOW/YEAR",
"MediaGroupNames": "",
"MediaTypeNames": "",
"RootProductGroupIDs": "",
"CollectionNameList": "Article",
"GroupList": "",
"CachingEnabled": false,
"FieldFacets": {},
"SolrPageSize": 500,
"QueryFacets": {},
"SolrResultCount": 2,
"LastModifiedEndDate": null,
"FacetFieldPrefix": "",
"DatabaseVersion": 10.0006,
"MediaMetaDataOptionalIDs": "",
"FacetQueries": [],
"SolrStartPosition": 0,
"KeywordNOTOperators": "",
"Timeout": 5000,
"MinFacetCount": 1,
"SolrParameters": [],
"PropertyFile": "./etc/dbprops.dat",
"GroupLimit": 2147483647,
"ApproxTotalResults": 2,
"LastModifiedStartDate": null,
"SubsiteID": 0,
"DetailLevel": 4,
"SummaryAction": 1,
"DidYouMean": "",
"RecordedGatewayMessages": [],
"MaxRows": 50,
"UseCache": false,
"RecordGatewayMessages": false,
"RootProductRackIDs": "",
"SearchCommandAction": 0,
"HighlightingEnabled": false,
"KeywordStemming": true,
"Keywords": "Tim",
"VerityRestartPosition": 1,
"ClusteringField": "",
"MaxFacets": 10,
"DateFacets": {},
"RootMediaGroupIDs": "",
"FieldConstraints": [],
"RootThreadIDs": "",
"More": false,
"MediaMetaDataIDs": "",
"FilterQueries": [],
"UserID": 0,
"ArticleMetaDataOptionalIDs": "",
"FacetFields": [],
"BoostSearch": true,
"FacetDateGap": "+1MONTH",
"CaseSensitive": false,
"SearchCommand": null,
"GroupOffset": 0,
"KeywordANDOperators": "",
"FacetDateEnd": "NOW",
"FacetDates": [],
"KeywordOperator": 1,
"RootForumIDs": "",
"Preview": false,
"SearchEngineRestartPosition": 1,
"SortOrder": "",
"StartRow": 1,
"ArticleMetaDataIDs": "",
"ColdFusionVersion": 0,
"FacetParameters": [],
"UseLuceneCollections": true,
"DebugOutput": false,
"DisplayDateCriteria": "(*:* -keytype:Article -keytype:Media) OR (displaystartdate:[* TO \"2018-02-14T10:49:19Z\"] AND displayenddate:{\"2018-02-14T10:49:19Z\" TO *})"
}
},
"success": true
}
Example Request - Limited Properties
In this request we just want the count of results.
client.invoke("icmapi", "CSSearchMultiple_get", {
"set": {
"CollectionNameList": "Article",
"LuceneRepositoryPath": "http://localhost:5506/solrsite",
"Keywords": "Tim"
},
"get": "SolrResultCount"
});
Example Response - Limited Properties
Note how the CSSearchItem details aren't returned when we define properties in the get request.
"result": {
"data": {
"multipleItemData": [{
"_ItemClass": "CSSearchItem"
}, {
"_ItemClass": "CSSearchItem"
}],
"itemData": {
"_ItemClass": "CSSearchMultiple",
"SolrResultCount": 2
}
},
"success": true
}
Date Faceting
You can perform faceting using the get method. The facets will be present in the DateFacets property of the returned itemData.
Note that this method creates facets for the returned results. The results themselves are not filtered or restricted in any way. To apply facets a subsequent request would have to be made, generally adding the facet as a filter query.
For more examples of faceting, see the knowledge base section of this site.
DateMathParser Syntax
Dates can be passed to SOLR in an ISO 8601 format, "2016-06-01T00:00:00Z", or using DateMathParser (opens new window). This syntax lets you set times in the past (-) or future (+) and round (/) to the start of the current unit.
Common strings include:
NOW - The date and time right now
/MONTH - The start of the current month
+1DAY - One day in the future from now
-1YEAR - One year ago from now
Request Parameters
By default only 10 facets are returned. Set MaxFacets to return a different number.
Name | Type | Description |
---|---|---|
set.CollectionNameList | String, required | A comma separated list of the collections you'd like to search. Not all collections are available in the solrsite collection (see above). * searches all |
set.LuceneRepositoryPath | String, required | The path to the SOLR collection |
set.Keywords | String | A comma separated list of keywords to search for. The default operator OR is used (can be changed using the KeywordOperator property). Either Keywords or SearchCommand must be set |
set.SearchCommand | String | The search command to pass directly to SOLR. Useful if constructing more complex (eg function) searches. By default ignores other properties that restrict the search (behaviour can be changed using the SearchCommandAction property). Either Keywords or SearchCommand must be set |
set.FacetDates | Array | You can facet on creationdate, modificationdate, etc |
set.FacetDateStart | String | Either an ISO 8601 combined date-time or a value constructed using DateMathParser syntax |
set.FacetDateEnd | String | Either an ISO 8601 combined date-time or a value constructed using DateMathParser syntax |
set.FacetDateGap | String | A DateMathParser value for the gap used to group results into facets |
get.[property,property] | String | A comma separated list of the properties of CSSearchMultiple you would like to get. * returns all |
Example Request
This is the same request as above, but with month facets configured between the start of 2016 and now.
client.invoke("icmapi", "CSSearchMultiple_get", {
"set": {
"CollectionNameList": "Article",
"LuceneRepositoryPath": "http://localhost:5506/solricm",
"Keywords": "Tim",
"FacetDates": ["creationdate"],
"FacetDateStart": "2016-01-01T00:00:00Z",
"FacetDateEnd": "NOW",
"FacetDateGap": "+1MONTH",
},
"get": "SolrResultCount,DateFacets"
});
Response Properties
Name | Type | Description |
---|---|---|
data.multipleItemData | Array | An array of CSSearchItems matching the properties of the get request |
data.itemData | Object | The properties of the get request, including faceting results |
Example Response
Three results have been found, falling into two months.
"result": {
"data": {
"multipleItemData": [{
"_ItemClass": "CSSearchItem"
}, {
"_ItemClass": "CSSearchItem"
}, {
"_ItemClass": "CSSearchItem"
}],
"itemData": {
"_ItemClass": "CSSearchMultiple",
"SolrResultCount": 3,
"DateFacets": {
"creationdate": {
"2017-01-01T00:00:00Z": 1,
"2018-02-01T00:00:00Z": 2
}
}
}
},
"success": true
}
Field Faceting
Field facets work in a broadly similar way to date facets, faceting on a property of the returned CSSearchItems, not just the date fields. As with Date Facets, any configured facets are returned in the FieldFacets property of the returned itemData.
Request Parameters
By default only 10 facets are returned. Set MaxFacets to return a different number.
Name | Type | Description |
---|---|---|
set.CollectionNameList | String, required | A comma separated list of the collections you'd like to search. Not all collections are available in the solrsite collection (see above). * searches all |
set.LuceneRepositoryPath | String, required | The path to the SOLR collection |
set.Keywords | String | A comma separated list of keywords to search for. The default operator OR is used (can be changed using the KeywordOperator property). Either Keywords or SearchCommand must be set |
set.SearchCommand | String | The search command to pass directly to SOLR. Useful if constructing more complex (eg function) searches. By default ignores other properties that restrict the search (behaviour can be changed using the SearchCommandAction property). Either Keywords or SearchCommand must be set |
set.FieldFacets | Array | You can facet on creationdate, modificationdate, etc |
set.FacetFieldPrefix | String | You can optionally restrict the facets returned to those that start with this string |
get.[property,property] | String | A comma separated list of the properties of CSSearchMultiple you would like to get. * returns all |
Example Request
In this example the dynamic OBJECT_RAWC_ field is being used as a facet. This special field is used to preserve the article title which would otherwise have each word broken down into individual tokens.
client.invoke("icmapi", "CSSearchMultiple_get", {
"set": {
"CollectionNameList": "Article",
"LuceneRepositoryPath": "http://localhost:5506/solricm",
"Keywords": "Tim",
"FacetFields": ["OBJECT_RAWC__title"]
},
"get": "SolrResultCount,FieldFacets"
});
Example Response
Faceting by title probably isn't the best thing to do, as most article titles will be fairly unique. Including
"result": {
"data": {
"multipleItemData": [{
"_ItemClass": "CSSearchItem"
}, {
"_ItemClass": "CSSearchItem"
}, {
"_ItemClass": "CSSearchItem"
}],
"itemData": {
"_ItemClass": "CSSearchMultiple",
"FieldFacets": {
"OBJECT_RAWC__title": {
"latest news": 1,
"tim's article": 1,
"locations": 1
}
},
"SolrResultCount": 3
}
},
"success": true
}
Properties
Property | Type | Description |
---|---|---|
ApproxTotalResults | Integer | The approximate number of total matching results. The value is approximate as it does not account for the on/off state or security of the items returned. Only accessible content will actually be returned in the search results. SolrResultCount returns a true count of the returned results |
ArticleMetaDataIDs | String | A string of comma separated metadata value IDs. Only articles that have all of these values related to them will be returned |
ArticleMetaDataOptionalIDs | String | A string of comma separated metadata value IDs. Only articles that have any one of these values related to them will be returned |
BoostSearch | Boolean | Whether the search should take the "boost value" of an article into account. See Article Search Optimisation for more information. Default: true. Note that the boost property only applies to the solrsite search collection, not solricm |
CaseSensitive | Boolean | If true the search (either keyword or command) will be case sensitive. Default: false. Note that keywords or search commands all in uppercase seem to ignore this property |
CollectionNameList | String | A string of comma separated collection names to search in (Article, Media etc listed above) |
DateFacets | Object | The property in the returned itemData that holds the facet dates (if any) |
DidYouMean | String | If EnableDidYouMean is set as true this property holds the returned suggestion |
EnableDidYouMean | Boolean | If set as true, and a search returns no results, the DidYouMean property will return a corrected suggestion. Default: false. This feature only exists for the solrsite collection, not solricm |
FacetDateEnd | String | Used with FacetDateStart to set the range between which date facets will be created. Either an ISO 8601 combined date-time or a value constructed using DateMathParser syntax. Note this does not limit the search results to this end date. See faceting below for more information. Default: "NOW" |
FacetDateGap | String | The interval for date faceting, constructed using DateMathParser syntax. See above for more information. Default: "+1MONTH" |
FacetDates | Array | An array of date properties to facet on eg "modificationdate", "creationdate", "displaystartdate", "displayenddate" |
FacetDateStart | String | Used with FacetDateEnd to set the range between which date facets will be created. Either an ISO 8601 combined date-time or a value constructed using DateMathParser syntax. Note this does not limit the search results to this start date. See faceting below for more information. Default: "NOW/YEAR" (the start of the current year) |
FacetFieldPrefix | String | Used with FacetFields. Only facets that start with this string will be returned. See above for an example |
FacetFields | Array | An array of property names from CSSearchItem to facet on. See above for an example |
FacetQueries | Array | An array of facet queries. Used to send more complex facet queries directly to the SOLR engine |
FieldFacets | Object | The property in the returned itemData that holds the facet fields (if any) |
FilterQueries | Array | An array of filter queries. Defines a query that can be used to restrict the superset of items that are returned, like applying facets to the main query. Also used when the SearchCommand contains a SOLR function query |
GroupField | String | A property from CSSearchItem used to group results. Unlike facets which return a list of results and a count of items that match configured facets, grouping groups the results themselves. Generally only makes sense to group by metadata. Cannot be used in conjunction with GroupQueries |
GroupLimit | Integer | Limit the number of results returned in each group. The NumFound property of CSSearchGroup will still count the full number |
GroupList | String | A comma separated list of website user group IDs. Set in conjunction with UserID (otherwise serves no purpose) |
GroupOffset | Integer | If limiting the number of results returned per group, the number of results to skip. For example, should a group have 20 results, and you are limiting the results to four, an offset of 1 would display results 2-5, an offset of 4 results 5-8 etc |
GroupQueries | Array | An array of group queries. Cannot be used in conjunction with GroupField. Used to send more complex group queries directly to the SOLR engine |
HighlightingEnabled | Boolean | Whether the searched for term will have a span tag and class applied to it in the returned result summaries. For example <span class="icmhighlight">GOSS</span> |
KeywordANDOperators | String | A space separated list of characters you'd like to treat as AND operators. The defaults are AND and &&. If for some reason you wanted to treat the search term GOSS HELLOSAILOR Office as GOSS AND Office you could do that by setting |
KeywordNOTOperators | String | A space separated list of characters to treat as NOT operators. See the AND operators above |
KeywordOperator | Integer | The operator that will be used between keywords: 1 - ACCRUE 2 - OR 3 - AND 4 - MANY Default: OR |
KeywordOROperators | String | As per the AND and NOT entries above |
Keywords | String | A string of words to search for. Stemming will be applied and the OR operator is used |
KeywordStemming | Boolean | Always enabled. Searching for film will return results for film, films, filming etc. Setting this property as false should disable stemming, but it doesn't seem to work |
LastModifiedEndDate | DateTime | Only results modified before this date will be returned. Dates in an ISO 8601 combined format, ie "2018-02-01T00:00:00Z" |
LastModifiedStartDate | DateTime | Only results modified after this date will be returned. Dates in an ISO 8601 combined format, ie "2018-02-01T00:00:00Z" |
LuceneRepositoryPath | String | The path to SOLR |
MaxFacets | Integer | The maximum number of facets to return. Default: 10 |
MediaMetaDataIDs | String | A string of comma separated metadata value IDs. Only media items that have all of these values related to them will be returned |
MediaMetaDataOptionalIDs | String | A string of comma separated metadata value IDs. Only media items that have any one of these values related to them will be returned |
MediaTypeNames | String | A string of comma separated media type names. Only media items of these types will be returned |
MinFacetCount | Integer | The minimum number of results a facet must have for it to appear. Default: 1 (so facets with single results will appear) |
QueryFacets | Object | The property in the returned itemData that holds the facet queries (if any) |
RootArticleIDs | String | A string of comma separated article IDs. Only the root items and their child items will be searched |
RootForumIDs | String | A string of comma separated forum IDs. Only the root items and their child items will be searched |
RootMediaGroupIDs | String | A string of comma separated media group IDs. Only the root items and their child items will be searched |
RootProductGroupIDs | String | A string of comma separated product group IDs. Only the root items and their child items will be searched |
RootProductRackIDs | String | A string of comma separated product rack IDs. Only the root items and their child items will be searched |
RootThreadIDs | String | A string of comma separated forum thread IDs. Only the root items and their child items will be searched |
SearchCommand | String | A string containing the search command. This overrides the keywords properties and, by default, ignores any root items or other restrictions set up. Generally only needed for more complex queries |
SearchCommandAction | Integer | Sets whether the search command overrides search restrictions or not. 1 - Override the restrictions 2 - Only override the keywords property Default: 1 |
SolrPageSize | Integer | The number of CSSearchItems to display. Often used with SolrStartRow to implement paging |
SolrParameters | Array | An array of SOLR parameter objects, each with Name and Value properties. See above |
SolrResultCount | Integer | The number of results returned from SOLR |
SolrStartPosition | Integer | The first CSSearchItem to display (zero based) from the results. Only needed when accessing results past the first 500, otherwise use StartRow |
StartRow | Integer | The index of the first CSSearchItem displayed (1 based) from within those that would appear based on the SolrStartPosition. For example, paging has been implemented, the SolrPageSize displays 10 results per page, we're on page 2, so normally result 11 would appear first. Setting a StartRow of 2 would mean result 12 would appear first (and result 11 wouldn't appear on any page) |
SubsiteID | Integer | The ID of the subsite to search. This property will be ignored if RootArticleIDs or RootMediaIDs have been set |
SummaryAction | Integer | Removes/manipulates markup in the Summary property of the CSSearchItem: If the summary text is "test" goss <hahaha> 1 - No Action eg "Summary": "\"test\" goss <hahaha>" 2 - Remove Tags eg "Summary": "\"test\" goss " 3 - Escape Tags eg "Summary": ""test" goss <hahaha>" |
Timeout | Integer | The maximum time to wait during connection and getting results |
UserID | Integer | A website UserID. Supply a UserID to return secure content in the search results. Performance can be improved by also supplying the list of the website user group IDs to which the specified user belongs. |