Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mus'ab 102 posts 284 karma points notactivated
    5 days ago
    Mus'ab
    0

    How to order examine results by date time property ?

    Hi

    i am trying to order examine results based on date time property like bellow

     if (ExamineManager.Instance.TryGetIndex("ExternalIndex", out var index))
            {
                var searcher = index.GetSearcher();
                ISearchResults results = null;
                results = searcher.CreateQuery()
                                .Field("path", newsSource.Path.ToString().MultipleCharacterWildcard()).And()
                                .Field("__IndexType", "content")
                                .And().Field("__NodeTypeAlias", "newsItem").And().Field("disabled","0")
                                .OrderByDescending(new SortableField[] { new SortableField("publish_time") }).Execute();
    

    but i think that didn't work a already changed the index type of property from text string to date time but i still get the results without ordering.

    any idea ?

Please Sign in or register to post replies

Write your reply to:

Draft