FTSearchScore (NotesDocument - JavaScript)

Read-only. The full-text search score of a document, if it was retrieved as part of a full-text search.

Defined in

NotesDocument

Syntax

getFTSearchScore() : int

Usage

The score is determined by the number of target words that are found in the document, the term weights assigned to the target words, and any proximity operators in the search query. If the document is not retrieved as part of a full-text search, returns 0. If the document is retrieved using an FTSearch method on a database without a full-text index, this property returns an unpredictable number.

If a document is in more than one NotesDocumentCollection or NotesViewEntryCollection, its score is that of the last collection from which it was retrieved. The score is correct unless you get the score from the current object after retrieving the same document from another collection.

Documents added to a collection have a search score of 0.

Documents deleted from a view have a search score of 0.

Examples

This button gets the search score and subject item from the result of a full-text search.
database.updateFTIndex(true);
var dc:NotesDocumentCollection = database.FTSearch(requestScope.query);
if (dc.getCount() == 0) {
	requestScope.status = "No hits";
	return;
}
requestScope.status = "Hits:";
var doc:NotesDocument = dc.getFirstDocument();
while (doc != null) {
	requestScope.status += "\n" + doc.getFTSearchScore()
	+ "\t" + doc.getItemValueString("subject");
	var tmpdoc = dc.getNextDocument();
	doc.recycle(); // recycle to avoid memory problems
	doc = tmpdoc;
}