title: Solr: Scoring exact matches higher than partial matches
body: <p>In a very simple case, I have three documents with filenames "Lark", "Larker", and "Larking" (no file extension). In solr, I index these three documents mapping the filename to a "title" field. When I do a search for "Lark" all three documents are returned (which is what I want) but they are all given the same score. I would prefer that "Lark" be scored the highest, as it is an exact match to my query, with the others coming behind.</p>
  
  <pre><code>&lt;field name="title" type="text_general" indexed="true" stored="true" multiValued="false"/&gt;
  </code></pre>
  
  <p>&nbsp;</p>
  
  <pre><code>&lt;fieldType name="text_general" class="solr.TextField" positionIncrementGap="100"&gt;
    &lt;analyzer type="index"&gt;
      &lt;tokenizer class="solr.StandardTokenizerFactory"/&gt;
      &lt;filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /&gt;
      &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
      &lt;filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front"/&gt;
    &lt;/analyzer&gt;
    &lt;analyzer type="query"&gt;
      &lt;tokenizer class="solr.StandardTokenizerFactory"/&gt;
      &lt;filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /&gt;
      &lt;filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/&gt;
      &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
    &lt;/analyzer&gt;
  &lt;/fieldType&gt;
  </code></pre>
  
  <p>I believe the reason they are getting the same score is because of the <code>EdgeNGramFilterFactory</code> employed at index time. Each document gets indexed as "La", "Lar", "Lark" with two of the documents ("Larker" and "Larking") being indexed with some additional variations. So in effect each document is an exact match for the query "Lark." I would like some way of executing a query where the term "Lark" would return all three documents but with the document titled "Lark" being returned higher than the others.</p>
  
  <p>Results of query debug:</p>
  
  <pre><code>&lt;lst name="debug"&gt;
    &lt;str name="rawquerystring"&gt;Lark&lt;/str&gt;
    &lt;str name="querystring"&gt;Lark&lt;/str&gt;
    &lt;str name="parsedquery"&gt;text:lark&lt;/str&gt;
    &lt;str name="parsedquery_toString"&gt;text:lark&lt;/str&gt;
    &lt;lst name="explain"&gt;
      &lt;str name="543d6ee4cbb33c26bbcf288b/xxnullxx/543d6ef9cbb33c26bbcf2892"&gt;
  2.7104912 = (MATCH) weight(text:lark in 0) [DefaultSimilarity], result of:
    2.7104912 = fieldWeight in 0, product of:
      1.4142135 = tf(freq=2.0), with freq of:
        2.0 = termFreq=2.0
      3.8332133 = idf(docFreq=3, maxDocs=68)
      0.5 = fieldNorm(doc=0)
  &lt;/str&gt;
      &lt;str name="543d6ee4cbb33c26bbcf288b/xxnullxx/543d6ef9cbb33c26bbcf2893"&gt;
  2.7104912 = (MATCH) weight(text:lark in 1) [DefaultSimilarity], result of:
    2.7104912 = fieldWeight in 1, product of:
      1.4142135 = tf(freq=2.0), with freq of:
        2.0 = termFreq=2.0
      3.8332133 = idf(docFreq=3, maxDocs=68)
      0.5 = fieldNorm(doc=1)
  &lt;/str&gt;
      &lt;str name="543d6ee4cbb33c26bbcf288b/xxnullxx/543d6ef9cbb33c26bbcf2894"&gt;
  2.7104912 = (MATCH) weight(text:lark in 2) [DefaultSimilarity], result of:
    2.7104912 = fieldWeight in 2, product of:
      1.4142135 = tf(freq=2.0), with freq of:
        2.0 = termFreq=2.0
      3.8332133 = idf(docFreq=3, maxDocs=68)
      0.5 = fieldNorm(doc=2)
  &lt;/str&gt;
  </code></pre>