Need help on SPFX web part properties search issue #spfx #603
With Reference to old issue #603 I am reopening it with new issue. We are having some issue in same context with Search on Modern Pages. We are getting content in crawl for Modern Pages but that content is having Web GUID padded with property content ie XXXX-XXXX-XXXX-XXXXHello World. So because of this we are not able to search content when we type Hello World in Search text box. This happened when we assign plain text value to Web Part Properties but if we assign html text to web part properties we are able to search it. for ex when we create rich text box we are assigning html text property value so in that case content is searchable. Please let us know if we are missing anything while implementation. We are using below code as mentioned in trail message. protected get propertiesMetadata(): IWebPartPropertiesMetadata { return { 'spfxcrawl' : {isHtmlString: true} } } @andrewconnell , @manishgarg1 and @patmill waiting for your reply.
Hi @sameersalunke ,
Thanks for the feedback. As you have discovered, isHtmlString only works for html content. In fact, it should only be used if the value of the property is guaranteed to be valid html content.
If you want to make plain text searchable, use isSearchablePlainText property.
protected get propertiesMetadata(): IWebPartPropertiesMetadata {
return {
'spfxcrawl' : {isSearchablePlainText : true}
}
}
I realized that our documentation for IWebPartPropertyMetadata has not surfaced properly on the reference website, which makes it hard to discover this feature. We will track that issue.
I'm going to resolve this issue. Feel free to re-open if the problem persists.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues