sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Need help on SPFX web part properties search issue #spfx

Open sameersalunke opened this issue 9 years ago • 7 comments

We need help on SharePoint SPFX implementation. We have created one sample web part and one description property in it. When we are trying to search that property we are not able to search it. We have tried adding this web part to classic and modern pages. In Modern Page we found that it is crawling properties with webpart id + property content. In Classic Page it is not searching.

We have added below code for making property searchable but it is not working.

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

Thanks in Advance

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

If you are planning to share a new feature request (enhancement / suggestion), please use SP Dev UserVoice at http://aka.ms/sp-dev-uservoice.

Expected or Desired Behavior

If you are reporting a bug, please describe the expected behavior. If you are suggesting an enhancement please describe thoroughly the enhancement, how it can be achieved, and expected benefit.

Observed Behavior

If you are reporting a bug, please describe the behavior you expected to occur when performing the action. If you are making a suggestion, you can delete this section.

Steps to Reproduce

If you are reporting a bug please describe the steps to reproduce the bug in sufficient detail to allow testing. Only way to fix things properly, is to have sufficient details to reproduce it. If you are making a suggestion, you can delete this section.

Submission Guidelines

Delete this section after reading

  • All suggestions or bugs are welcome, please let us know what's on your mind.
  • If you are reporting an issue around any of the documents or articles, please ensure that you have clear reference on the specific file or URL, which should be fixed.
  • If you have technical questions about the framework, we’ll be monitoring #spfx, #spfx-webparts, and #spfx-tooling on (SharePoint StackExchange)[http://sharepoint.stackexchange.com/]. You can also alternatively submit your question to (SharePoint Developer group)[https://network.office.com/t5/SharePoint-Developer/bd-p/SharePointDev] at Office Network.
  • Remember to include sufficient details and context.
  • If you have multiple suggestions or bugs please submit them in separate bugs so we can track resolution.

Thanks for your contribution! Sharing is caring.

sameersalunke avatar May 25 '17 11:05 sameersalunke

@andrewconnell Do you have any thoughts on the above issue?

sameersalunke avatar May 25 '17 11:05 sameersalunke

@patmill Please let us know do you have any info, we need solution on this else we will loose the lead?

sameersalunke avatar May 25 '17 11:05 sameersalunke

Hi @sameersalunke, modern web part properties are not searchable in classic pages. This is currently a limitation in the implementation.

manishgarg1 avatar Jun 05 '17 17:06 manishgarg1

(Sorry for the delay - was off riding bikes). As @manishgarg1 mentions, the search only works on modern pages. I'd adjust his response slightly, in that it is a limitation with how webparts work in classic pages, not in the implementation of modern webparts. Basically, all the content in classic pages gets serialized into the webparts table, and the webparts table isn't search indexed. We've made webparts get indexed by search in modern pages as a base feature. It's not feasible to rewrite the classic webpart pipeline to get this.

patmill avatar Jun 06 '17 00:06 patmill

Hi @sameersalunke, we greatly appreciate your feedback. Since the question has been answered, I am resolving the issue. Please feel free to re-activate the issue if you have any further questions on this matter.

manishgarg1 avatar Jun 06 '17 14:06 manishgarg1

Thanks @manishgarg1 and @patmill . 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} } }

sameersalunke avatar Jun 06 '17 17:06 sameersalunke

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

msft-github-bot avatar Jan 29 '20 12:01 msft-github-bot