Results 1 to 10 of 10
  1. #1
    Allasso is offline Member
    Join Date
    Nov 2009
    Posts
    6
    Rep Power
    0

    Default get hit scoring?

    Hello,

    I would to be able to get the score for each a hit returned to use for post processing. Hit.getScore() is deprecated, so is there a way to still do this? Much Googling has turned up nothing.

    thanks,

    Allasso

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  3. #3
    Allasso is offline Member
    Join Date
    Nov 2009
    Posts
    6
    Rep Power
    0

    Default

    I don't understand your question. I understand Lucene to be an API using Java that is provided by Apache.

    Allasso

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Sorry about that. I'm not clear with my question. I just want to know that same concept use in php as well. Never mind.

    Did you read the API? They have a recommendation for that deprecated method.

    Hits (Lucene 2.2.0 API)


  5. #5
    Allasso is offline Member
    Join Date
    Nov 2009
    Posts
    6
    Rep Power
    0

    Default

    reading the 2.9.1 docs, the entire Hits class is deprecated.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  7. #7
    Allasso is offline Member
    Join Date
    Nov 2009
    Posts
    6
    Rep Power
    0

    Default

    I never found any recommendations, but I finally stumbled on a way to get it:

    ScoreDoc.score

    the way I got it in my app:

    Java Code:
    TopScoreDocCollector collector = TopScoreDocCollector.create(hitsPerPage, true);
    ScoreDoc[] hits = collector.topDocs().scoreDocs;
    hits[i].score
    Thank you much, Eranga

    Allasso

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    From where you find about this. If you have any related stuff can you send it to me here. If I update my stuff then I have to deal with those as well in near future.

  9. #9
    Allasso is offline Member
    Join Date
    Nov 2009
    Posts
    6
    Rep Power
    0

    Default

    Soooooooooo sorry, Eranga,

    After my last post I never came back to the forum, so I didn't see your request. If I remember I didn't find it on a forum or anything, I just started working with TopScoreDocCollector class, trying the methods, looking at the classes of the objects they return, etc, until I finally got it to work.

    The irony is, I ended up not using it after all.

    Allasso

  10. #10
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Replies: 1
    Last Post: 02-04-2008, 09:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •