类 CmsSearchDirective

所有已实现的接口:
Directive, HttpDirective, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel
直接已知子类:
CmsFacetSearchDirective

@Component public class CmsSearchDirective extends AbstractTemplateDirective

search 内容列表查询指令

search content list query directive

search コンテンツリストクエリーディレクティブ

参数列表

parameter list

パラメータリスト

  • word:搜索词,多个搜索词时取并集结果
  • word:search word, take union result when multiple search words
  • word:検索語、複数の検索語の場合は合併結果を取得
  • exclude:排除词汇
  • exclude:exclude words
  • exclude:除外語彙
  • tagIds:多个标签id,多个标签时取并集结果
  • tagIds:multiple tag ids, take union result when multiple tags
  • tagIds:複数のタグID、複数のタグの場合は合併結果を取得
  • userId:用户id
  • userId:user id
  • userId:ユーザーID
  • parentId:父内容id
  • parentId:parent content id
  • parentId:親コンテンツID
  • categoryId:分类id
  • categoryId:category id
  • categoryId:カテゴリID
  • containChild:包含子分类,当categoryId不为空时有效
  • containChild:include subcategories, effective when categoryId is not empty
  • containChild:categoryIdが空でないときにサブカテゴリを含める
  • categoryIds:多个分类id,当categoryId为空时有效
  • categoryIds:multiple category ids, effective when categoryId is empty
  • categoryIds:categoryIdが空のときに複数のカテゴリID
  • modelIds:多个模型id
  • modelIds:multiple model ids
  • modelIds:複数のモデルID
  • extendsValues 多个全文搜索字段値,格式:[字段编码]:字段値],例如: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 result
  • dictionaryUnion 辞書値の合併結果を取得、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 value
  • highlight:キーワードのハイライト、[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】,默认为false
  • projection:projection result, [true,false], default is false
  • projection:投影結果、[true,false]、既定値はfalse
  • phrase:精确搜索,【true,false】,默认为false
  • phrase:exact search, [true,false], default is false
  • phrase:正確な検索、[true,false]、既定値はfalse
  • fields:搜索字段,【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)
  • containsAttributedefault is false, advanced option for http requests, when true, content.attribute is content extended data map(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 relevance
  • orderField ソートフィールド、[clicks:クリック数の降順、score:スコアの降順、publishDate:公開日の降順、collections:コレクション数の降順、minPrice:最低価格、maxPrice:最高価格、extend.sort1-extend.sort10]:拡張フィールドのソートフラグ]、既定値は関連性の降順
  • pageIndex:页码
  • pageIndex:page number
  • pageIndex:ページ番号
  • pageSize:每页条数
  • pageSize:number of items per page
  • pageSize:ページあたりのアイテム数
  • maxResults:最大结果数
  • maxResults:maximum number of results
  • maxResults:最大結果数

返回结果

return result

戻り値

  • page:PageHandler
  • page.list:List类型 查询结果实体列表 CmsContent
  • page.list:List type query result entity list CmsContent
  • 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>