concept function query in category lucene

This is an excerpt from Manning's book Lucene in Action, Second Edition.
Table 1.1. Lucene’s release history
Version
Release date
Milestones
0.01 March 2000 First open source release (SourceForge) 1.0 October 2000 1.01b July 2001 Last SourceForge release 1.2 June 2002 First Apache Jakarta release 1.3 December 2003 Compound index format, QueryParser enhancements, remote searching, token positioning, extensible scoring API 1.4 July 2004 Sorting, span queries, term vectors 1.4.1 August 2004 Bug fix for sorting performance 1.4.2 October 2004 IndexSearcher optimization and miscellaneous fixes 1.4.3 November 2004 Miscellaneous fixes 1.9.0 February 2006 Binary stored fields, DateTools, NumberTools, RangeFilter, RegexQuery; requires Java 1.4 1.9.1 March 2006 Bug fix in BufferedIndexOutput 2.0 May 2006 Removed deprecated methods 2.1 February 2007 Delete/update document in IndexWriter, locking simplifications, QueryParser improvements, benchmark contrib module 2.2 June 2007 Performance improvements, function queries, payloads, preanalyzed fields, custom deletion policies 2.3.0 January 2008 Performance improvements, custom merge policies and merge schedulers, background merges by default, tool to detect index corruption, IndexReader.reopen 2.3.1 February 2008 Bug fixes from 2.3.0 2.3.2 May 2008 Bug fixes from 2.3.1 2.4.0 October 2008 Further performance improvements, transactional semantics (rollback, commit), expungeDeletes method, delete by query in IndexWriter 2.4.1 March 2009 Bug fixes from 2.4.0 2.9 September 2009 New per-segment Collector API, faster search performance, near real-time search, attribute-based analysis 2.9.1 November 2009 Bug fixes from 2.9 2.9.2 February 2010 Bug fixes from 2.9.1 3.0.0 November 2009 Removed deprecated methods, fixed some bugs 3.0.1 February 2010 Bug fixes from 3.0.0
Many applications that implement search with Lucene can do so using the API introduced in chapter 3. Some projects, though, need more than the basic searching mechanisms. Perhaps you need to use security filters to restrict which documents are searchable for certain users, or you’d like to see search results sorted by a specific field, such as title, instead of by relevance. Using term vectors, you can find documents similar to an existing one, or automatically categorize documents. Function queries allow you to use arbitrary logic when computing scores for each hit, enabling you to boost relevance scores according to recency. We’ll cover all of these examples in this chapter.
Lucene’s relevance scoring formula, which we discussed in chapter 3, does a great job of assigning relevance to each document based on how well it matches the query. But what if you’d like to modify or override how this scoring is done? In section 5.2 you saw how you can change the default relevance sorting to sort instead by one or more fields, but what if you need even more flexibility? This is where function queries come in.
Function queries give you the freedom to programmatically assign scores to matching documents using your own logic. All classes are from the org.apache.lucene.search.function package. In this section we first introduce the main classes used by function queries, and then see the real-world example of using function queries to boost recently modified documents.