类 CmsSearchDirective
java.lang.Object
com.publiccms.common.directive.BaseTemplateDirective
com.publiccms.common.base.AbstractTemplateDirective
com.publiccms.views.directive.cms.CmsSearchDirective
- 所有已实现的接口:
Directive
,HttpDirective
,freemarker.template.TemplateDirectiveModel
,freemarker.template.TemplateModel
- 直接已知子类:
CmsFacetSearchDirective
search 内容列表查询指令
search content list query directive
search コンテンツリストクエリーディレクティブ
search コンテンツリストクエリーディレクティブ
参数列表
parameter list
パラメータリスト
word
:搜索词,多个搜索词时取并集结果word
:search word, take union result when multiple search wordsword
:検索語、複数の検索語の場合は合併結果を取得exclude
:排除词汇exclude
:exclude wordsexclude
:除外語彙tagIds
:多个标签id,多个标签时取并集结果tagIds
:multiple tag ids, take union result when multiple tagstagIds
:複数のタグID、複数のタグの場合は合併結果を取得userId
:用户iduserId
:user iduserId
:ユーザーIDparentId
:父内容idparentId
:parent content idparentId
:親コンテンツIDcategoryId
:分类idcategoryId
:category idcategoryId
:カテゴリIDcontainChild
:包含子分类,当categoryId不为空时有效containChild
:include subcategories, effective when categoryId is not emptycontainChild
:categoryIdが空でないときにサブカテゴリを含めるcategoryIds
:多个分类id,当categoryId为空时有效categoryIds
:multiple category ids, effective when categoryId is emptycategoryIds
:categoryIdが空のときに複数のカテゴリIDmodelIds
:多个模型idmodelIds
:multiple model idsmodelIds
:複数のモデルIDextendsValues
多个全文搜索字段値,格式:[字段编码]:字段値],例如:extendsValues='isbn:value1,unicode:value2'extendsValues
multiple full-text search field values, format: [field code]:field value], e.g.: extendsValues='isbn:value1,unicode:value2'extendsValues
複数の全文検索フィールド値、形式:[フィールドコード]:フィールド値],例:extendsValues='isbn:value1,unicode:value2'dictionaryValues
多个字典搜索字段値,只有数据字典父级値時包含所有子级结果,格式:[字段编码]_[字段値],例如:dictionaryValues='extend1_value1,extend1_value2'dictionaryValues
multiple dictionary search field values, include all child results when only data dictionary parent value, format: [field code]_[field value], e.g.: dictionaryValues='extend1_value1,extend1_value2'dictionaryValues
複数の辞書検索フィールド値、データ辞書親値のみの場合はすべての子結果を含む、形式:[フィールドコード]_[フィールド値],例:dictionaryValues='extend1_value1,extend1_value2'dictionaryUnion
取数据字典并集结果,dictionaryUnion不为空时有效,【true,false】,默认为交集结果dictionaryUnion
take union result of dictionary values, effective when dictionaryUnion is not empty, [true,false], default is intersection resultdictionaryUnion
辞書値の合併結果を取得、dictionaryUnionが空でないときに有効、[true,false]、既定値は交差結果highlight
:高亮关键词,【true,false】,默认为false,启用高亮后, 标题、作者、编辑、描述字段应该加?no_esc以使高亮html生效,cms会自动对原值有进行html安全转义highlight
:highlight keywords, [true,false], default is false, after enabling highlight, title, author, editor, description fields should add ?no_esc to make highlight html effective, cms will automatically perform html safety escaping on the original valuehighlight
:キーワードのハイライト、[true,false]、既定値はfalse、ハイライトを有効にした後、 タイトル、著者、編集者、説明フィールドにはハイライトhtmlを有効にするために?no_escを追加する必要があります。cmsは元の値に対して自動的にhtmlセーフティエスケープを実行しますpreTag
:高亮前缀,启用高亮时有效,默认为"<B>"preTag
:highlight prefix, effective when highlight is enabled, default is "<B>"preTag
:ハイライトのプレフィックス、ハイライトが有効な場合に有効、既定値は"<B>"postTag
:高亮后缀,启用高亮时有效,默认为"</B>"postTag
:highlight suffix, effective when highlight is enabled, default is "</B>"postTag
:ハイライトのサフィックス、ハイライトが有効な場合に有効、既定値は"</B>"projection
:投影结果,【true,false】,默认为falseprojection
:projection result, [true,false], default is falseprojection
:投影結果、[true,false]、既定値はfalsephrase
:精确搜索,【true,false】,默认为falsephrase
:exact search, [true,false], default is falsephrase
:正確な検索、[true,false]、既定値はfalsefields
:搜索字段,【title:标题, author:作者, editor:编辑, description:描述, text:正文,files:附件】fields
:search fields, [title:title, author:author, editor:editor, description:description, text:text,files:attachments]fields
:検索フィールド、[title:タイトル, author:著者, editor:編集者, description:説明, text:本文,files:添付ファイル]containsAttribute
默认为false
,http请求时为高级选项,为true时content.attribute
为内容扩展数据map
(字段编码,value
)containsAttribute
default isfalse
, advanced option for http requests, when true,content.attribute
is content extended datamap
(field code,value
)containsAttribute
既定値はfalse
, HTTPリクエスト時の高度なオプション、trueの場合content.attribute
はコンテンツ拡張データmap
(フィールドコード,value
)startPublishDate
:起始发布日期,【2000-01-01 23:59:59】,【2000-01-01】startPublishDate
:start publish date, [2000-01-01 23:59:59],[2000-01-01]startPublishDate
:公開開始日、[2000-01-01 23:59:59],[2000-01-01]endPublishDate
:终止发布日期,【2000-01-01 23:59:59】,【2000-01-01】endPublishDate
:end publish date, [2000-01-01 23:59:59],[2000-01-01]endPublishDate
:公開終了日、[2000-01-01 23:59:59],[2000-01-01]orderField
排序字段,【clicks:点击数倒序,score:分数倒序,publishDate:发布日期倒序,collections:收藏数倒叙,minPrice:最低价格,maxPrice:最高价格,extend.sort1-extend.sort10]:扩展字段排序标志】,默认相关度倒序orderField
sort field, [clicks:clicks in descending order,score:score in descending order,publishDate:publish date in descending order,collections:collections in descending order,minPrice:min price,maxPrice:max price,extend.sort1-extend.sort10]:extended field sort flag], default is descending order of relevanceorderField
ソートフィールド、[clicks:クリック数の降順、score:スコアの降順、publishDate:公開日の降順、collections:コレクション数の降順、minPrice:最低価格、maxPrice:最高価格、extend.sort1-extend.sort10]:拡張フィールドのソートフラグ]、既定値は関連性の降順pageIndex
:页码pageIndex
:page numberpageIndex
:ページ番号pageSize
:每页条数pageSize
:number of items per pagepageSize
:ページあたりのアイテム数maxResults
:最大结果数maxResults
:maximum number of resultsmaxResults
:最大結果数
返回结果
return result
戻り値
page
:PageHandler
page.list
:List类型 查询结果实体列表CmsContent
page.list
:List type query result entity listCmsContent
page.list
:リスト型 クエリ結果エンティティリストCmsContent
<@cms.search word='cms' pageSize=10><#list page.list as a>${a.title}<#sep>,</#list></@cms.search>
<script> $.getJSON('${site.dynamicPath}api/directive/cms/search?word=cms&pageSize=10', function(data){ console.log(data.page.totalCount); }); </script>
-
字段概要
字段修饰符和类型字段说明private CmsContentAttributeService
protected ContentConfigComponent
protected FileUploadComponent
private CmsContentService
private StatisticsComponent
从类继承的字段 com.publiccms.common.base.AbstractTemplateDirective
ADVANCED, APP_TOKEN, AUTH_TOKEN, AUTH_USER_ID, siteComponent
从类继承的字段 com.publiccms.common.directive.BaseTemplateDirective
log
从接口继承的字段 freemarker.template.TemplateModel
NOTHING
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
execute
(RenderHandler handler) query
(RenderHandler handler, boolean factSearch) boolean
从类继承的方法 com.publiccms.common.base.AbstractTemplateDirective
execute, expose, getAdvanced, getApp, getSite, getUser, getUserId, needAppToken, needUserToken
从类继承的方法 com.publiccms.common.directive.BaseTemplateDirective
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
-
字段详细资料
-
attributeService
-
statisticsComponent
-
contentConfigComponent
-
fileUploadComponent
-
service
-
-
构造器详细资料
-
CmsSearchDirective
public CmsSearchDirective()
-
-
方法详细资料
-
execute
public void execute(RenderHandler handler) throws IOException, freemarker.template.TemplateException - 参数:
handler
-- 抛出:
IOException
freemarker.template.TemplateException
-
query
public PageHandler query(RenderHandler handler, boolean factSearch) throws freemarker.template.TemplateModelException - 抛出:
freemarker.template.TemplateModelException
-
supportAdvanced
public boolean supportAdvanced()- 覆盖:
supportAdvanced
在类中AbstractTemplateDirective
- 返回:
- support advanced parameters
-