Copied to clipboard

Flag this post as spam?

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


  • Peter Kongyik 28 posts 170 karma points
    Mar 25, 2015 @ 11:13
    Peter Kongyik
    1

    Limit the Examine search result

    Hi guys!

    I'd like to limit the size of the returning result set of my examine search to gain performance. I've found that lucene's Lucene.Net.Search.Searcher class supports it, but I've not found any clue of this on the Examine ISearcher class.

    Can this be achieved somehow?

    thanks in advance,
    Peter

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Mar 25, 2015 @ 12:14
    Ismail Mayat
    0

    Peter,

    As far as I am aware with Examine you cannot limit results returned however you can do a .Take() on the returned results, still means you are returning everything from lucene but not to your display layer.

    Regards

     

    Ismail

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Mar 25, 2015 @ 12:24
    Ismail Mayat
    101

    Peter,

    Just had a look at the code on github and https://github.com/Shazwazza/Examine/blob/82043c8dd204a79316098d2d5b9004dd0a6d4645/Projects/Examine/LuceneEngine/Providers/BaseLuceneSearcher.cs line 167 there is overloaded search method that takes maxResults parameter. Which version of Examine are you using?

    Regards

    Ismail

  • Peter Kongyik 28 posts 170 karma points
    Mar 25, 2015 @ 13:13
    Peter Kongyik
    0

    Hi Ismail!

    Thanks for you feedback perfect, I'm using version 0.1.60.2941, the ones that umbraco 7.2.4 ships with, and just noticed that

    ExamineManager.Instance.SearchProviderCollection

    returns a BaseLuceneSearcher, which actually has the write overload, thanks!

    1 question still remains which just came into my mind: is there a method which returns only the count of the result set, without the limitation? So Examine does not build the documents, only returns a count.

    thanks,
    Peter 

  • nickornotto 397 posts 900 karma points
    May 08, 2019 @ 23:32
    nickornotto
    0

    I am also looking to returns only the count of results, not results themselves.

    Have you found the answer to your question?

Please Sign in or register to post replies

Write your reply to:

Draft