Home | Trees | Indices | Help |
|
---|
|
object --+ | datastructures.ProcessedDocument --+ | SearchResult
A result from a search.
As well as being a ProcessedDocument representing the document in the database, the result has several members which may be used to get information about how well the document matches the search:
rank
: The rank of the document in the search results, starting at 0 (ie, 0 is the "top" result, 1 is the second result, etc).weight
: A floating point number indicating the weight of the result document. The value is only meaningful relative to other results for a given search - a different search, or the same search with a different database, may give an entirely different scale to the weights. This should not usually be displayed to users, but may be useful if trying to perform advanced reweighting operations on search results.percent
: A percentage value for the weight of a document. This is just a rescaled form of theweight
member. It doesn't represent any kind of probability value; the only real meaning of the numbers is that, within a single set of results, a document with a higher percentage corresponds to a better match. Because the percentage doesn't really represent a probability, or a confidence value, it is probably unhelpful to display it to most users, since they tend to place an over emphasis on its meaning. However, it is included because it may be useful occasionally.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
Properties | |
Inherited from Inherited from |
Method Details |
Create a ProcessedDocument. fieldmappings is the configuration from a database connection used lookup the configuration to use to store each field. If supplied,
|
Return a summarised version of the field specified. This will return a summary of the contents of the field stored in the search result, with words which match the query highlighted. The maximum length of the summary (in characters) may be set using the maxlen parameter. The return value will be a string holding the summary, with highlighting applied. If there are multiple instances of the field in the document, the instances will be joined with a newline character. To turn off highlighting, set hl to None. Each highlight will consist
of the first entry in the Any XML or HTML style markup tags in the field will be stripped before the summarisation algorithm is applied. If Raises KeyError if the field is not known. |
Return a highlighted version of the field specified. This will return all the contents of the field stored in the search result, with words which match the query highlighted. The return value will be a list of strings (corresponding to the list of strings which is the raw field data). Each highlight will consist of the first entry in the If If Raises KeyError if the field is not known. |
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Tue Apr 29 09:21:55 2008 | http://epydoc.sourceforge.net |