SOLVED

Getting rich text from SPFx web parts into the search index

Copper Contributor

Hi there,

 

I've used react-script-editor, react-textboxio, and react-tinymce from the samples folder in sp-dev-fx-webparts to add rich content to pages, but that rich content never gets added to the indexed text of the page, and consequently does not become searchable. In fact, none of the text in any non-stock webparts that I've seen ever gets put into the search index - only the built-in Microsoft webparts seem to do this.

How can I remedy this? If the built-in webparts are doing it, then there's obviously a way, yes?

2 Replies
best response confirmed by Aaron Hawryluk (Copper Contributor)
Solution

Hi @Aaron Hawryluk. Actually, the content in the react-textboxio sample Web Part is indexed as an HTML string according to this configuration:

 

 

protected get propertiesMetadata(): IWebPartPropertiesMetadata {
    return {
    'content' : {isHtmlString: true}
    };
  }

As I remember and according to this thread, the content is indexed and then available trough the "Description" managed property so it is not available trough the full text index. Can you check if you can get your content by querying this property explicitly?

 

 

Franck.

 

Thanks Franck, that worked!

1 best response

Accepted Solutions
best response confirmed by Aaron Hawryluk (Copper Contributor)
Solution

Hi @Aaron Hawryluk. Actually, the content in the react-textboxio sample Web Part is indexed as an HTML string according to this configuration:

 

 

protected get propertiesMetadata(): IWebPartPropertiesMetadata {
    return {
    'content' : {isHtmlString: true}
    };
  }

As I remember and according to this thread, the content is indexed and then available trough the "Description" managed property so it is not available trough the full text index. Can you check if you can get your content by querying this property explicitly?

 

 

Franck.

 

View solution in original post