Copied to clipboard

Flag this post as spam?

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


  • Angel Stubbings 3 posts 73 karma points
    Aug 17, 2017 @ 10:03
    Angel Stubbings
    0

    Examine Lucene RawQuery boost create date

    Hi,

    I'm trying to sort my search results so that items with the latest date will have a higher Lucene score and show up at the top of the results. This is my raw query at the moment, which I edited from https://umbraco.com/blog/examining-examine/

    var luceneString = "nodeName:";
    luceneString += "(+" + searchTerm.Replace(" ", " +") + ")^10 ";
    luceneString += "nodeName:" + searchTerm + "~0.8";
    luceneString += " bodytext:" + searchTerm + "~0.8";
    

    Does anyone know how to include a boost on createDate please?

    Thanks!

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Aug 17, 2017 @ 11:35
    Ismail Mayat
    0

    Angel,

    Why not just sort by date? In this instance unless you are searching by date i do not see how you can boost it?

    Regards

    Ismail

  • Angel Stubbings 3 posts 73 karma points
    Aug 18, 2017 @ 07:07
    Angel Stubbings
    0

    Hi Ismail,

    Thank you for your reply. I want to sort by relevance then by date and this doesn't seem to be working:

    var searchResults = searcher.Search(query).OrderByDescending(x => x.Score).ThenBy(r => r.Fields["createDate"]);
    

    If there is no way to boost the date then does anybody know why the above isn't working?

    Thanks, Angel

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Mar 16, 2018 @ 12:59
    Søren Gregersen
    0

    sorry for opening an old thread...

    by doing the above, you sort outside examine. You need to add the sorting to your query :)

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Aug 18, 2017 @ 09:16
    Ismail Mayat
    0

    Angel,

    Once you sort by any field then score has no meaning. In fact after a sort if you write out the score you should get NAN as its no longer relevant.

    Regards

    Ismail

  • Mohsin Bhatti 14 posts 92 karma points
    Sep 05, 2017 @ 12:19
    Mohsin Bhatti
    0

    Hi Ismali

    Could you help me for below query?

  • Mohsin Bhatti 14 posts 92 karma points
    Sep 05, 2017 @ 12:15
    Mohsin Bhatti
    0

    Hi Ismail,

    I am trying to delete some images and get the following error message, do you know why this error arise?

    enter image description here

    ould you please help me it's urgent from client side?

    we are using Umbraco version 7.1.4 version

    when i select any page/image to delete and click ok button in console section one error generated regarding :

    enter image description here

    i reach the path that show in error where 'segments_1k' not exist. how this file help to resolve my issue. could you know what is the purpose of this file. If you have any idea please share with us so that i will resolve this error ASAP.

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Sep 05, 2017 @ 13:26
    Ismail Mayat
    0

    Mohsin,

    Ideally you should have created new post and not added to existing post which is different topic. However it may be your external index is corrupt. So goto developer section examine management indexers / external index and rebuild. Then try and delete your media item.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft