Creating freshness scoring function for DateTimeOffset field in Edm.ComplexType

Pasieka Manuel 20 Reputation points
2024-09-23T10:55:00.3266667+00:00

Hi,

I have an index that contains a DateTimeOffset field within an ComplexType

meta/updated_at

I want to create a freshness scoring function that gives higher rating to documents with more recent updates. Creating such a function throught he web portal, I get a generic error, that the field update_at is not found. I checked its of the type DateTimeOffset and its retrievable.

Do scoring functions work with fields ***inside ***complex types?

best,
Manuel

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,343 questions
0 comments No comments
{count} votes

Accepted answer
  1. Q&A Assist
    2024-09-23T10:55:00.3466667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Yes, scoring functions can work with fields inside complex types. However, when creating a scoring profile through the Azure portal, you need to use the full path to the field, including the names of any parent complex types. In your case, the full path to the updated_at field would be meta/updated_at. Make sure to use this full path when creating your scoring function.

    If you continue to receive an error, you may want to check that the field is marked as filterable and that you are using the correct data type (Edm.DateTimeOffset).

    I hope this helps!


    References:

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Pasieka Manuel 20 Reputation points
    2024-09-23T10:56:37.4766667+00:00

    AI for the rescue! Yes the Web Portal seems to have created the wrong scoring profiles json, missing the parent name of the field.

    Manually editing the index json, and including the parent field name solved the issue.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.