forked from sunspot/sunspot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add support for mlt.interestingTerms
- Loading branch information
Showing
7 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module Sunspot | ||
module Search | ||
# | ||
# InterestingTerm encapsulates the information returned by solr | ||
# when specifying mlt.interestingTerms = list or details | ||
# | ||
class InterestingTerm | ||
# | ||
# Actual term that is extracted by the MoreLikeThisHandler in solr. | ||
# Results returned by more_like_this are found by searching for this term. | ||
# | ||
attr_reader :term | ||
|
||
# | ||
# Field of this interesing term, or nil if interesting_terms is | ||
# not :details | ||
# | ||
attr_reader :field | ||
|
||
# | ||
# Score of this interesting term, or nil if interesting_terms is | ||
# not :details | ||
# | ||
attr_reader :score | ||
|
||
def initialize(term, field = nil, score = nil) #:nodoc: | ||
@term = term | ||
@field = field | ||
@score = score | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters