Git Product home page Git Product logo

Comments (8)

Divyeshkotadia avatar Divyeshkotadia commented on May 21, 2024 1

Thanks a ton @wobba appreciated your efforts.

We tried propertiesMetadata() method and following are the behavior we are getting:

  1. Content does not appear in the Search results for classic pages.
  2. For modern pages, the behavior is even more baffling. It actually indexes content with a webpart ID as a prefix to the Search text. The user would then need to enter a search string that looks like this: “{WebpartID}SearchText”.

Please let us know your valuable comments.

from sp-dev-fx-webparts.

wobba avatar wobba commented on May 21, 2024

@patmill any input on this?

from sp-dev-fx-webparts.

patmill avatar patmill commented on May 21, 2024

Hi Mikael - sorry for not responding here. I was looking at the sp-dev-docs issues list.

So the current implementation of this should result in all of the webpart content being in the index with the rest of the page content. The goal being primarily to surface all of the user content in the full text index, rather than having arbitrary crawled / managed properties. It is something we could consider in the future, but would require a fair chunk of work. I'll bubble up the request though. Thanks,

from sp-dev-fx-webparts.

wobba avatar wobba commented on May 21, 2024

Thank you @patmill. But it still doesn't make sense that all web part properties are appended to the Description managed property upon indexing, or? So some work is already in place here ;)

I do get the point of having custom properties as part of the fti, but using this as a way to add metadata instead of doing content types seems to make a whole lot of sense to me. But at least I know how the current implementation works.

from sp-dev-fx-webparts.

Divyeshkotadia avatar Divyeshkotadia commented on May 21, 2024

I am facing slightly different issue in which I want SPFX webpart content to be crawled and popup in search result but it doesn't. Any idea how I can make it work or it is something that current implementation does not support? Please provide valuable inputs... @wobba @patmill

from sp-dev-fx-webparts.

wobba avatar wobba commented on May 21, 2024

@Divyeshkotadia by adding the function in my question - propertiesMetadata(), you should be able to specify which web part properties are added to the index. If you want the rendered html crawled, you need to add that as part of a webpart property.

from sp-dev-fx-webparts.

Divyeshkotadia avatar Divyeshkotadia commented on May 21, 2024

@wobba thanks for your prompt response.. I have tried what you mentioned but it does not work out... Is it possible for you to share sample code.. Secondly will it work on classic pages as well because my implementation is used on those pages and content that user has entered should be searchable through search. Let me know if you don't relate any part of my query...
Thank you very much...Cheers!!!

from sp-dev-fx-webparts.

wobba avatar wobba commented on May 21, 2024

@Divyeshkotadia Here's a sample React part:
`
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library';
import {
BaseClientSideWebPart,
IPropertyPaneConfiguration,
PropertyPaneTextField,
IWebPartPropertiesMetadata
} from '@microsoft/sp-webpart-base';

import * as strings from 'puzzlepartMetadataStrings';
import PuzzlepartMetadata from './components/PuzzlepartMetadata';
import { IPuzzlepartMetadataProps } from './components/IPuzzlepartMetadataProps';
import { IPuzzlepartMetadataWebPartProps } from './IPuzzlepartMetadataWebPartProps';

export default class PuzzlepartMetadataWebPart extends BaseClientSideWebPart<IPuzzlepartMetadataWebPartProps> {

  public render(): void {
	const element: React.ReactElement<IPuzzlepartMetadataProps> = React.createElement(
	  PuzzlepartMetadata,
	  {
		Keywords: this.properties.Keywords,
		Kash: this.properties.Kash
	  }
	);

	ReactDom.render(element, this.domElement);
  }

  protected get dataVersion(): Version {
	return Version.parse('1.0');
  }

  protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
	return {
	  pages: [
		{
		  header: {
			description: strings.PropertyPaneDescription
		  },
		  groups: [
			{
			  groupName: strings.BasicGroupName,
			  groupFields: [
				PropertyPaneTextField('Keywords', {
				  label: strings.KeywordsFieldLabel
				}),
				PropertyPaneTextField('Kash', {
				  label: "Extra"
				})
			  ]
			}
		  ]
		}
	  ]
	};
  }

  protected get propertiesMetadata(): IWebPartPropertiesMetadata {
	return {
	  'Keywords': { isHtmlString: true },
	  'Kash': { isHtmlString: true }
	};
  }
}

`

from sp-dev-fx-webparts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.