Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Include attached file content to page search result

Vote:
 

I am having a specific page type with a property that is holding a file as this:

    [Display(
        GroupName = SystemTabNames.Content,
        Order = 400)]
    [UIHint(UIHint.MediaFile)]
    public virtual Url Document { get; set; }

How can I include the content of that file to the page in the find index?

How should I write the search query for finding pages (with attached file) that are matching the search query?

#302771
Jun 01, 2023 8:31
Vote:
 

Hi Robert,

What type of searching are you implementing unified search, multi-search, typed search? Depending upon this you will basis how you get the document.

Are you trying to search the document? or more just have a query that returns the content and the file?

Would be good to look at https://docs.developers.optimizely.com/digital-experience-platform/v1.1.0-search-and-navigation/docs/searching to get a basis of what you want.

Paul

#303038
Edited, Jun 06, 2023 13:59
Vote:
 
#303250
Edited, Jun 09, 2023 10:00
Vote:
 

Hi Robet,

Glad you found a solution that works.

I see that this solution uses conventions to index the document as part of the page model in the index.

You can read more about customizing the indexing behaviour here https://docs.developers.optimizely.com/digital-experience-platform/v1.1.0-search-and-navigation/docs/indexing#conventions.

Thanks

Paul 

#303371
Edited, Jun 12, 2023 7:59
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.