You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2011/03/10 22:16:27 UTC

[Solr Wiki] Update of "FunctionQuery" by YonikSeeley

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "FunctionQuery" page has been changed by YonikSeeley.
The comment on this change is: document relevance function queries.
http://wiki.apache.org/solr/FunctionQuery?action=diff&rev1=74&rev2=75

--------------------------------------------------

  
  See the java.util.Math javadocs for more details.
  
+ == Relevance Functions ==
+ [[Solr4.0]]
+ 
+ Relevancy functions that take terms can use a bare term if it's a simple word
+  . Example: '''docfreq(text,solr)'''
+ Can optionally quote the term if it's more complex
+  . Example: '''docfreq(text,'solr')'''
+ And can even do parameter substitution for the term value
+  . Example Partial Request: '''&defType=func&q=docfreq(text,$myterm)&term=solr'''
+ 
+ === docfreq ===
+ '''docfreq(field,term)''' returns the number of documents that contain the term in the field.  This is a constant (the same value for all documents in the index).
+ 
+  . Example Syntax: '''docfreq(text,'solr')'''
+ 
+ === termfreq ===
+ '''termfreq(field,term)''' returns the number of times the term appears in the field for that document.
+ 
+  . Example Syntax: '''docfreq(text,'memory')'''
+ 
+ === idf ===
+ '''idf(field,term)''' returns the inverse document frequency for the given term, using the [[http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucene/search/Similarity.html|Similarity] for the field.
+ 
+  . Example Syntax: '''idf(text,'solr')'''
+ 
+ === tf ===
+ '''tf(field,term)''' returns the term frequency factor for the given term, using the [[http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucene/search/Similarity.html|Similarity] for the field.
+ 
+  . Example Syntax: '''tf(text,'solr')'''
+ 
+ === norm ===
+ '''norm(field)''' returns the "norm" stored in the index, the product of the index time boost and then length normalization factor, according to the  [[http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucene/search/Similarity.html|Similarity] for the field.
+ 
+  . Example Syntax: '''norm(text)'''
+ 
+ === maxdoc ===
+ '''maxdoc()''' returns the number of documents in the index, including those that are marked as deleted but have not yet been purged.  This is a constant (the same value for all documents in the index).
+ 
+ === numdocs ===
+ '''numdocs()''' returns the number of documents in the index, not including those that are marked as deleted but have not yet been purged.  This is a constant (the same value for all documents in the index).
+ 
+ 
  == dist ==
  [[Solr3.1]]