# Class ContentSearchModel

- [TopLevel.Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - [dw.catalog.SearchModel](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md)
    - [dw.content.ContentSearchModel](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md)

The class is the central interface to a content search result and a content
search refinement. It also provides utility methods to generate a search URL.

## Constant Summary

| Constant                                                                                                                                | Description                      |
| --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| [CONTENTID_PARAMETER](#contentid_parameter): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "cid" | URL Parameter for the content ID |
| [FOLDERID_PARAMETER](#folderid_parameter): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "fdid"  | URL Parameter for the folder ID  |

## Property Summary

| Property                                                                                                                                                            | Description                                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [content](#content): [Iterator](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Iterator.md) `(read-only)`                                            | Returns an Iterator containing all Content Assets that are the result of the  search.                                                                                            |
| [contentID](#contentid): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)                                                         | Returns the content ID against which the search results apply.                                                                                                                   |
| [deepestCommonFolder](#deepestcommonfolder): [Folder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.Folder.md) `(read-only)`                     | Returns the deepest common folder of all content assets in the search result.                                                                                                    |
| [filteredByFolder](#filteredbyfolder): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)                                         | The method returns true, if the content search result is filtered by the folder and it is not subsequently  possible to search for content assets that belong to no folder (e.g. |
| [folder](#folder): [Folder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.Folder.md) `(read-only)`                                               | Returns the folder against which the search results apply.                                                                                                                       |
| [folderID](#folderid): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)                                                           | Returns the folder ID against which the search results apply.                                                                                                                    |
| [folderSearch](#foldersearch): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`                                   | The method returns true, if this is a pure search for a folder.                                                                                                                  |
| [pageMetaTags](#pagemetatags): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md) `(read-only)`                                       | Returns all page meta tags, defined for this instance for which content can be generated.                                                                                        |
| [recursiveFolderSearch](#recursivefoldersearch): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)                               | Get the flag that determines if the folder search will  be recursive.                                                                                                            |
| [refinedByFolder](#refinedbyfolder): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`                             | The method returns true, if the search is refined by a folder.                                                                                                                   |
| [refinedFolderSearch](#refinedfoldersearch): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`                     | Identifies if this is a folder search and is refined with further  criteria, like a name refinement or an attribute refinement.                                                  |
| [refinements](#refinements): [ContentSearchRefinements](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchRefinements.md) `(read-only)` | Returns the set of search refinements used in this search.                                                                                                                       |

## Constructor Summary

| Constructor                                 | Description                          |
| ------------------------------------------- | ------------------------------------ |
| [ContentSearchModel](#contentsearchmodel)() | Constructs a new ContentSearchModel. |

## Method Summary

| Method                                                                                                                                                                                                                                                                                                                                                                                                     | Description                                                                                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [getContent](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#getcontent)()                                                                                                                                                                                                                                                                                          | Returns an Iterator containing all Content Assets that are the result of the  search.                                                                                            |
| [getContentID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#getcontentid)()                                                                                                                                                                                                                                                                                      | Returns the content ID against which the search results apply.                                                                                                                   |
| [getDeepestCommonFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#getdeepestcommonfolder)()                                                                                                                                                                                                                                                                  | Returns the deepest common folder of all content assets in the search result.                                                                                                    |
| [getFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#getfolder)()                                                                                                                                                                                                                                                                                            | Returns the folder against which the search results apply.                                                                                                                       |
| [getFolderID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#getfolderid)()                                                                                                                                                                                                                                                                                        | Returns the folder ID against which the search results apply.                                                                                                                    |
| [getPageMetaTag](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#getpagemetatagstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                          | Returns the page meta tag for the specified id.                                                                                                                                  |
| [getPageMetaTags](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#getpagemetatags)()                                                                                                                                                                                                                                                                                | Returns all page meta tags, defined for this instance for which content can be generated.                                                                                        |
| [getRefinements](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#getrefinements)()                                                                                                                                                                                                                                                                                  | Returns the set of search refinements used in this search.                                                                                                                       |
| [isFilteredByFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#isfilteredbyfolder)()                                                                                                                                                                                                                                                                          | The method returns true, if the content search result is filtered by the folder and it is not subsequently  possible to search for content assets that belong to no folder (e.g. |
| [isFolderSearch](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#isfoldersearch)()                                                                                                                                                                                                                                                                                  | The method returns true, if this is a pure search for a folder.                                                                                                                  |
| [isRecursiveFolderSearch](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#isrecursivefoldersearch)()                                                                                                                                                                                                                                                                | Get the flag that determines if the folder search will  be recursive.                                                                                                            |
| [isRefinedByFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#isrefinedbyfolder)()                                                                                                                                                                                                                                                                            | The method returns true, if the search is refined by a folder.                                                                                                                   |
| [isRefinedFolderSearch](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#isrefinedfoldersearch)()                                                                                                                                                                                                                                                                    | Identifies if this is a folder search and is refined with further  criteria, like a name refinement or an attribute refinement.                                                  |
| [search](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#search)()                                                                                                                                                                                                                                                                                                  | Execute the search.                                                                                                                                                              |
| [setContentID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#setcontentidstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                              | Sets the contentID used in this search.                                                                                                                                          |
| [setFilteredByFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#setfilteredbyfolderboolean)([Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md))                                                                                                                                                                             | Set a flag to indicate if the search is filtered by the folder.                                                                                                                  |
| [setFolderID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#setfolderidstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                                | Sets the folderID used in this search.                                                                                                                                           |
| [setRecursiveFolderSearch](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#setrecursivefoldersearchboolean)([Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md))                                                                                                                                                                   | Set a flag to indicate if the search in folder should be recursive.                                                                                                              |
| static [urlForContent](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlforcontenturl-string)([URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                     | Returns an URL that you can use to execute a query for a specific  Content.                                                                                                      |
| static [urlForContent](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlforcontentstring-string)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                          | Returns an URL that you can use to execute a query for a specific  Content.                                                                                                      |
| static [urlForFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlforfolderurl-string)([URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                       | Returns an URL that you can use to execute a query for a specific  Folder.                                                                                                       |
| static [urlForFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlforfolderstring-string)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                            | Returns an URL that you can use to execute a query for a specific  Folder.                                                                                                       |
| static [urlForRefine](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlforrefineurl-string-string)([URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))            | Returns an URL that you can use to execute a query for a specific  attribute name-value pair.                                                                                    |
| static [urlForRefine](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlforrefinestring-string-string)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)) | Returns an URL that you can use to execute a query for a specific  attribute name-value pair.                                                                                    |
| [urlRefineFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlrefinefolderurl-string)([URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                        | Returns an URL that you can use to re-execute the query using the  specified URL and folder refinement.                                                                          |
| [urlRefineFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlrefinefolderstring-string)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                             | Returns an URL that you can use to re-execute the query using the  specified pipeline action and folder refinement.                                                              |
| [urlRelaxFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlrelaxfolderurl)([URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md))                                                                                                                                                                                                     | Returns an URL that you can use to re-execute the query with no folder  refinement.                                                                                              |
| [urlRelaxFolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchModel.md#urlrelaxfolderstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                          | Returns an URL that you can use to re-execute the query with no folder  refinement.                                                                                              |

### Methods inherited from class SearchModel

[addRefinementValues](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#addrefinementvaluesstring-string), [canRelax](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#canrelax), [getCount](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#getcount), [getRefinementMaxValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#getrefinementmaxvaluestring), [getRefinementMinValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#getrefinementminvaluestring), [getRefinementValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#getrefinementvaluestring), [getRefinementValues](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#getrefinementvaluesstring), [getSearchPhrase](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#getsearchphrase), [getSearchRedirect](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#getsearchredirectstring), [getSortingCondition](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#getsortingconditionstring), [isEmptyQuery](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#isemptyquery), [isRefinedByAttribute](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#isrefinedbyattribute), [isRefinedByAttribute](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#isrefinedbyattributestring), [isRefinedByAttributeValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#isrefinedbyattributevaluestring-string), [isRefinedSearch](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#isrefinedsearch), [isRefinementByValueRange](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#isrefinementbyvaluerangestring), [isRefinementByValueRange](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#isrefinementbyvaluerangestring-string-string), [removeRefinementValues](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#removerefinementvaluesstring-string), [search](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#search), [setRefinementValueRange](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#setrefinementvaluerangestring-string-string), [setRefinementValues](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#setrefinementvaluesstring-string), [setSearchPhrase](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#setsearchphrasestring), [setSortingCondition](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#setsortingconditionstring-number), [url](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlurl), [url](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlstring), [urlDefaultSort](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urldefaultsorturl), [urlDefaultSort](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urldefaultsortstring), [urlRefineAttribute](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlrefineattributeurl-string-string), [urlRefineAttribute](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlrefineattributestring-string-string), [urlRefineAttributeValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlrefineattributevalueurl-string-string), [urlRefineAttributeValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlrefineattributevaluestring-string-string), [urlRefineAttributeValueRange](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlrefineattributevaluerangestring-string-string-string), [urlRelaxAttribute](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlrelaxattributeurl-string), [urlRelaxAttribute](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlrelaxattributestring-string), [urlRelaxAttributeValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlrelaxattributevalueurl-string-string), [urlRelaxAttributeValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlrelaxattributevaluestring-string-string), [urlSort](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlsorturl-string-number), [urlSort](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.catalog.SearchModel.md#urlsortstring-string-number)

### Methods inherited from class Object

[assign](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#assignobject-object), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject-object), [defineProperties](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertiesobject-object), [defineProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertyobject-object-object), [entries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#entriesobject), [freeze](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#freezeobject), [fromEntries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#hasownpropertystring), [is](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isobject-object), [isExtensible](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isextensibleobject), [isFrozen](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isfrozenobject), [isPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isprototypeofobject), [isSealed](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#issealedobject), [keys](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#keysobject), [preventExtensions](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#propertyisenumerablestring), [seal](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#sealobject), [setPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tolocalestring), [toString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tostring), [valueOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valueof), [values](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valuesobject)

## Constant Details

### CONTENTID_PARAMETER

- CONTENTID_PARAMETER: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "cid"
  - : URL Parameter for the content ID

***

### FOLDERID_PARAMETER

- FOLDERID_PARAMETER: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "fdid"
  - : URL Parameter for the folder ID

***

## Property Details

### content

- content: [Iterator](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Iterator.md) `(read-only)`
  - : Returns an Iterator containing all Content Assets that are the result of the
    search.

***

### contentID

- contentID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the content ID against which the search results apply.

***

### deepestCommonFolder

- deepestCommonFolder: [Folder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.Folder.md) `(read-only)`
  - : Returns the deepest common folder of all content assets in the search result.

***

### filteredByFolder

- filteredByFolder: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : The method returns true, if the content search result is filtered by the folder and it is not subsequently
    possible to search for content assets that belong to no folder (e.g. those for Page Designer).

***

### folder

- folder: [Folder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.Folder.md) `(read-only)`
  - : Returns the folder against which the search results apply.

***

### folderID

- folderID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the folder ID against which the search results apply.

***

### folderSearch

- folderSearch: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`
  - : The method returns true, if this is a pure search for a folder. The
    method checks, that a folder ID is specified and no search phrase is
    specified.

***

### pageMetaTags

- pageMetaTags: [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md) `(read-only)`
  - : Returns all page meta tags, defined for this instance for which content can be generated.

    The meta tag content is generated based on the content listing page meta tag context and rules.
    The rules are obtained from the current folder context or inherited from the parent folder,
    up to the root folder.

***

### recursiveFolderSearch

- recursiveFolderSearch: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Get the flag that determines if the folder search will
    be recursive.

***

### refinedByFolder

- refinedByFolder: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`
  - : The method returns true, if the search is refined by a folder.
    The method checks, that a folder ID is specified.

***

### refinedFolderSearch

- refinedFolderSearch: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`
  - : Identifies if this is a folder search and is refined with further
    criteria, like a name refinement or an attribute refinement.

***

### refinements

- refinements: [ContentSearchRefinements](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchRefinements.md) `(read-only)`
  - : Returns the set of search refinements used in this search.

***

## Constructor Details

### ContentSearchModel()

- ContentSearchModel()
  - : Constructs a new ContentSearchModel.

***

## Method Details

### getContent()

- getContent(): [Iterator](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Iterator.md)
  - : Returns an Iterator containing all Content Assets that are the result of the
    search.

    **Returns:**

    - an Iterator containing all Content Assets that are the result of the
      search.

***

### getContentID()

- getContentID(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the content ID against which the search results apply.

    **Returns:**

    - the content ID against which the search results apply.

***

### getDeepestCommonFolder()

- getDeepestCommonFolder(): [Folder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.Folder.md)
  - : Returns the deepest common folder of all content assets in the search result.

    **Returns:**

    - the deepest common folder of all content assets in the search result of this search model.

***

### getFolder()

- getFolder(): [Folder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.Folder.md)
  - : Returns the folder against which the search results apply.

    **Returns:**

    - the folder against which the search results apply.

***

### getFolderID()

- getFolderID(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the folder ID against which the search results apply.

    **Returns:**

    - the folder ID against which the search results apply.

***

### getPageMetaTag(String)

- getPageMetaTag(id: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [PageMetaTag](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.PageMetaTag.md)
  - : Returns the page meta tag for the specified id.

    The meta tag content is generated based on the content listing page meta tag context and rule.
    The rule is obtained from the current folder context or inherited from the parent folder,
    up to the root folder.

    Null will be returned if the meta tag is undefined on the current instance, or if no rule can be found for the
    current context, or if the rule resolves to an empty string.

    **Parameters:**

    - id - the ID to get the page meta tag for

    **Returns:**

    - page meta tag containing content generated based on rules

***

### getPageMetaTags()

- getPageMetaTags(): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Returns all page meta tags, defined for this instance for which content can be generated.

    The meta tag content is generated based on the content listing page meta tag context and rules.
    The rules are obtained from the current folder context or inherited from the parent folder,
    up to the root folder.

    **Returns:**

    - page meta tags defined for this instance, containing content generated based on rules

***

### getRefinements()

- getRefinements(): [ContentSearchRefinements](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.content.ContentSearchRefinements.md)
  - : Returns the set of search refinements used in this search.

    **Returns:**

    - the set of search refinements used in this search.

***

### isFilteredByFolder()

- isFilteredByFolder(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : The method returns true, if the content search result is filtered by the folder and it is not subsequently
    possible to search for content assets that belong to no folder (e.g. those for Page Designer).

    **Returns:**

    - True if this is filtered by the folder of the content asset.

***

### isFolderSearch()

- isFolderSearch(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : The method returns true, if this is a pure search for a folder. The
    method checks, that a folder ID is specified and no search phrase is
    specified.

    **Returns:**

    - True if this is a folder search.

***

### isRecursiveFolderSearch()

- isRecursiveFolderSearch(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Get the flag that determines if the folder search will
    be recursive.

    **Returns:**

    - true if the folder search will be recursive, false otherwise

***

### isRefinedByFolder()

- isRefinedByFolder(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : The method returns true, if the search is refined by a folder.
    The method checks, that a folder ID is specified.

    **Returns:**

    - true, if the search is refined by a folder, false otherwise.

***

### isRefinedFolderSearch()

- isRefinedFolderSearch(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Identifies if this is a folder search and is refined with further
    criteria, like a name refinement or an attribute refinement.

    **Returns:**

    - true if this is a folder search and is refined with further
      criteria, false otherwise.

***

### search()

- search(): [SearchStatus](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.SearchStatus.md)
  - : Execute the search.

    **Returns:**

    - the searchStatus object with search status code and description of search result.

***

### setContentID(String)

- setContentID(contentID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Sets the contentID used in this search.

    **Parameters:**

    - contentID - the contentID used in this search.

***

### setFilteredByFolder(Boolean)

- setFilteredByFolder(filteredByFolder: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)): void
  - : Set a flag to indicate if the search is filtered by the folder. Must be set to false to return content assets that
    do not belong to any folder.

    **Parameters:**

    - filteredByFolder - filter the search result by folder

***

### setFolderID(String)

- setFolderID(folderID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Sets the folderID used in this search.

    **Parameters:**

    - folderID - the folderID used in this search.

***

### setRecursiveFolderSearch(Boolean)

- setRecursiveFolderSearch(recurse: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)): void
  - : Set a flag to indicate if the search in folder should be recursive.

    **Parameters:**

    - recurse - recurse the folder in the search

***

### urlForContent(URL, String)

- static urlForContent(url: [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md), cid: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to execute a query for a specific
    Content. The passed url can be either a full url or just the name for a
    pipeline. In the later case a relative URL is created.

    **Parameters:**

    - url - the URL to use when constructing the new URL.
    - cid - the content id.

    **Returns:**

    - an URL that you can use to execute a query for a specific
      Content. The passed url can be either a full url or just the name
      for a pipeline. In the later case a relative URL is created.

***

### urlForContent(String, String)

- static urlForContent(action: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), cid: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to execute a query for a specific
    Content. The passed action is used to build an initial url. All search
    specific attributes are appended.

    **Parameters:**

    - action - the pipeline action to use.
    - cid - the content id.

    **Returns:**

    - an URL that you can use to execute a query for a specific
      Content. The passed action is used to build an initial url. All
      search specific attributes are appended.

***

### urlForFolder(URL, String)

- static urlForFolder(url: [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md), fid: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to execute a query for a specific
    Folder.

    **Parameters:**

    - url - the URL to use in constructing the new URL.
    - fid - the id of the Folder to use.

    **Returns:**

    - an URL that you can use to execute a query for a specific
      Folder.

***

### urlForFolder(String, String)

- static urlForFolder(action: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), fid: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to execute a query for a specific
    Folder.

    **Parameters:**

    - action - the pipeline action to use.
    - fid - the id of the Folder to use.

    **Returns:**

    - an URL that you can use to execute a query for a specific
      Folder.

***

### urlForRefine(URL, String, String)

- static urlForRefine(url: [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md), name: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), value: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to execute a query for a specific
    attribute name-value pair.

    **Parameters:**

    - url - the URL to use when constructing the new URL.
    - name - the name of the attribute.
    - value - the value for the attribute.

    **Returns:**

    - an URL that you can use to execute a query for a specific
      attribute name-value pair.

***

### urlForRefine(String, String, String)

- static urlForRefine(action: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), name: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), value: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to execute a query for a specific
    attribute name-value pair.

    **Parameters:**

    - action - the pipeline action to use.
    - name - the name of the attribute.
    - value - the value for the attribute.

    **Returns:**

    - an URL that you can use to execute a query for a specific
      attribute name-value pair.

***

### urlRefineFolder(URL, String)

- urlRefineFolder(url: [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md), refineFolderID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to re-execute the query using the
    specified URL and folder refinement.

    **Parameters:**

    - url - the existing URL to use when constructing the new URL.
    - refineFolderID - the ID of the folder refinement to use.

    **Returns:**

    - an URL that you can use to re-execute the query using the
      specified URL and folder refinement.

***

### urlRefineFolder(String, String)

- urlRefineFolder(action: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), refineFolderID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to re-execute the query using the
    specified pipeline action and folder refinement.

    **Parameters:**

    - action - the action to use.
    - refineFolderID - the folder ID to use as a refinement.

    **Returns:**

    - an URL that you can use to re-execute the exact same query using
      the specified pipeline action and folder refinement.

***

### urlRelaxFolder(URL)

- urlRelaxFolder(url: [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to re-execute the query with no folder
    refinement.

    **Parameters:**

    - url - the existing URL to use when constructing the new URL.

    **Returns:**

    - an URL that you can use to re-execute the query with no folder
      refinement.

***

### urlRelaxFolder(String)

- urlRelaxFolder(action: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [URL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.web.URL.md)
  - : Returns an URL that you can use to re-execute the query with no folder
    refinement.

    **Parameters:**

    - action - the pipeline action to use in the URL.

    **Returns:**

    - an URL that you can use to re-execute the query with no folder
      refinement.

***
