Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Oct 27, 2010 @ 09:10
    Ismail Mayat
    0

    Examine wildcard search score

    Not really examine issue more lucene issue but will ask just in case anyone knows the answer.  When i do a standard search in my index for the word bank i get 288 docs and for top results get score values like:

    03465

    0.3241

    0.3099

    When i repeat the same search but this time using wildcard query eg bank* i get value of 1 for all the scores.  This is the same for queries through examine and through luke in both instances i am using standard analyzer.  I have done in the past wildcard queries with umbSearch which was using lucene 1.9 and score worked e.g http://www.akcros.com/sitetools/searchresults.aspx?search=lead am I missing a trick some where with examine which uses lucene 2.9?

    Regards

    Ismail

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Oct 27, 2010 @ 11:52
    Aaron Powell
    0

    There's something different that Lucene does do with scoring when you're using wildcards, I remember it being mentioned in the Lucene in Action book, but I can't remember rightly what it is.

    You should still be getting numerical differences for the results though, that's for sure. I'd check the Lucene docs

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Oct 29, 2010 @ 10:43
    Ismail Mayat
    0

    Slace,

    Found this post http://www.gossamer-threads.com/lists/lucene/java-user/92194 basically the solution they are recommending is

    You need to change multiTermRewriteMethod of QueryParser. 
    qp.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE); 

    I guess thats something in the bowels of umbraco examine that would need changing?

    Regards

    Ismail

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Oct 29, 2010 @ 11:43
    Aaron Powell
    0

    Yeah that's not even close to being exposed :P

    You'd have to modify the way the fluent API is generating the query

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Oct 29, 2010 @ 11:59
    Ismail Mayat
    0

    Slace,

    Quick dirty hack i know for all our sites we will be using wildcard searches so i updated source in class LuceneSearchCriteria 

     this.queryParser = new MultiFieldQueryParser(luceneVersion, fields, analyzer);
     this.queryParser.SetAllowLeadingWildcard(allowLeadingWildcards);         
     queryParser.SetMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE); //my line here

    Does the trick not sure what it would do with non wildcard query might give it a whirl see what it does to scoring.

    Regards

    Ismail

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies