Try our conversational search powered by Generative AI!

How to be able to apply fuzzy search for custom property in Optimizely Graph

Vote:
 

Hi guys,

I am using some custom properties in Optimizely Graph model by adding properties within IContentApiModelProperty. I want to apply fuzzy search for custom property but cannot find the way to do it.

As I read in the document then a normal property in content type will be able to apply fuzzy search if marked as Searchable. But I do not find the way to mark Searchable for custom property.

Do you have any ideas about it?

#321811
Edited, May 10, 2024 3:48
Vote:
 

Hi Binh,

Can you expand on what you mean by "...by adding properties within IContentApiModelProperty" ? How are you adding these properties?

You can mark any property on the content type as searchable.

Note, Optimizely Graph supports fuzzy search for string fields and you enable it within the query for the supported operators. Refer to developer documentation for usage and examples

#322004
May 13, 2024 23:30
Vote:
 

Hi Ronil,

Thanks for your feedback. My properties are calculated properties. So I do not want to add them to content type as normal properties. I added custom properties to Graph model as same as this link https://blog.ynzen.com/how-to-add-a-custom-property-in-optimizely-graph

#322006
May 14, 2024 3:34
Vote:
 

I'm not sure how to mark custom (calculated) properties but string properties are marked searchable by default. Have you tried a fuzzy search on your custom property?

A possible workaround could be, assuming you are using Optimizely Graph in a PaaS setup, to add them as normal properties so they are searchable but hidden from edit view. 

E.g.

[ScaffoldColumn(false)]
public virtual string CalculatedProperty { get; set; }

Then you can still use your IContentApiModelProperty implementation to override the normal property with your calculated logic (by using the same property name).

#322009
May 14, 2024 6:40
Vote:
 

HI Ronil,

Yes, I see about the workaround. But it still does not help in case such as I want to use extended properties for searching all IContent data, not for a specific content type. So this workaround just works if I do search for a specific content type, not for general search.

I also saw in the code base and see that not all string properties are marked searchable by default. The properties are marked searchable if they have annotation [Searchable] or the system properties such as Name

#322069
May 15, 2024 3:49
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.