【问题标题】:How to search content inside source tab of a rich text field in Tridion如何在 Tridion 中的富文本字段的源选项卡内搜索内容
【发布时间】:2012-10-02 23:30:44
【问题描述】:

我目前正在使用以下代码在 Tridion 中进行搜索。它正在根据输入获取项目(组件和页面)。

问题:在富文本字段中,我们有设计、源代码和预览选项卡。以下代码仅搜索“设计”选项卡中存在的内容。我还需要源选项卡内容 在执行搜索时要考虑。

CoreServiceSession client = new CoreServiceSession();
SessionAwareCoreServiceClient csClient = client.GetClient();

var find = new SearchQueryData
{
  Description  = "Universe"
  ItemTypes = new ItemType[] { ItemType.Page, ItemType.Component }
);

IdentifiableObjectData[] foundItems = csClient.GetSearchResults(find);

【问题讨论】:

  • 您要搜索哪些内容在源选项卡中,而不是在设计选项卡中?

标签: tridion tridion-2011


【解决方案1】:

您尝试过 FullTextQuery

CoreServiceSession client = new CoreServiceSession();
SessionAwareCoreServiceClient csClient = client.GetClient();
ReadOptions readoption = new ReadOptions();

var find = new SearchQueryData
{
Description  = "Universe"
FullTextQuery= "Universe"
ItemTypes = new ItemType[] { ItemType.Component }
);

IdentifiableObjectData[] foundItems = csClient.GetSearchResults(find);

由于 FullTextQuery 会影响您的 CMS 性能,您可能希望它仅限于特定的架构组件字段。

BasedOnSchemaData basedSchemaNote = new BasedOnSchemaData();
    basedSchemaNote.Schema = new LinkToSchemaData() { IdRef = "tcm:XX-xxxx-8" };
    basedSchemaNote.Field = "FieldName";
    basedSchemaNote.FieldValue = "*SeachText*";

【讨论】:

    猜你喜欢
    • 2021-06-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-07
    • 2015-10-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多