-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
According to ContentItem Definition, each ContentItem has a top-level content field. At the same time, one of the properties in propertyValues can be marked as isContent in the schema using searchAnnotations
What's the difference between these two?
Are both used for full-text indexing or semantic vectorization?
If I already mark a schema property as isContent, should I still populate the top-level content field, or are they interchangeable?
This is my code:
public static DataSourceSchema GetSchema()
{
DataSourceSchema schema = new DataSourceSchema();
schema.PropertyList.Add(
new SourcePropertyDefinition
{
Name = nameof(summary),
Type = SourcePropertyType.String,
DefaultSearchAnnotations = (uint)(SearchAnnotations.IsSearchable | SearchAnnotations.IsContent),
RequiredSearchAnnotations = (uint)(SearchAnnotations.IsSearchable | SearchAnnotations.IsContent),
});
return schema;
}
public CrawlItem ToCrawlItem()
{
CrawlItem item = new CrawlItem
{
ItemType = CrawlItem.Types.ItemType.ContentItem,
ItemId = this.meetingId,
ContentItem = this.GetContentItem(),
};
return item;
}
private ContentItem GetContentItem()
{
return new ContentItem
{
AccessList = this.GetAccessControlList(),
PropertyValues = this.GetSourcePropertyValueMap(),
//1. content property is set with summary value
Content = new Content
{
ContentType = Content.Types.ContentType.Text,
ContentValue = this.summary
}
};
}
private SourcePropertyValueMap GetSourcePropertyValueMap()
{
SourcePropertyValueMap sourcePropertyValueMap = new SourcePropertyValueMap();
//2. summary(set "isContent in schema") in propertyValues is also set as summary value
sourcePropertyValueMap.Values.Add(
nameof(this.summary),
new GenericType
{
StringValue = summary,
});
return sourcePropertyValueMap;
}
}
Metadata
Metadata
Assignees
Labels
No labels