Hi, The "pf" feature will only kick in for phrases, i.e. multiple tokens. Per definition a "string" is one single token, so it will never kick in for strings.
A workaround can be found here: https://github.com/cominvent/exactmatch -- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com Solr Training - www.solrtraining.com 30. apr. 2013 kl. 20:52 skrev kirpakaroji <kirpakar...@yahoo.com>: > I have a question regarding boosting the exact match queries to top, > followed by partial match and if there is no exact match then give me > partial match. The following 2 solutions have yielded different results, and > I was not clear on it why > > This is the schema I have > > <field name="f1" type="string" indexed="true" stored="true" /> > <field name="f2" type="text_general" indexed="false" stored="true" > multiValued="true"/> > <field name="f3" type="pt_field" indexed="true" stored="true" /> > <copyField source="f1" dest="f3" /> > <uniqueKey>f1</uniqueKey> > > <fieldType name="pt_field" class="solr.TextField" > positionIncrementGap="100"> > <analyzer type="index"> > <tokenizer class="solr.WhitespaceTokenizerFactory"/> > <filter class="solr.WordDelimiterFilterFactory" > generateWordParts="1" generateNumberParts="1" catenateWords="1" > catenateNumbers="1" catenateAll="1" splitOnCaseChange="0"/> > > <filter class="solr.StopFilterFactory" ignoreCase="true" > words="./lang/stopwords_pt.txt" enablePositionIncrements="true"/> > <filter class="solr.LowerCaseFilterFactory" /> > <filter class="solr.SnowballPorterFilterFactory" > language="Portuguese"/> > </analyzer> > </fieldType> > > in my solrconfig.xml I have > <str name="df">f1</str> > <str name="qf">f1^10 f3^1</str> > <str name="pf">f1^10 f3^1</str> > > now if I try to specify the query with these parameters in solrconfig.xml, > 99% of the time exactmatch first and then partial match 1%of the time the > exact match result is in the index but does not show on the results and does > not give any partial matches for that query either. > > But if I make it qf=f3&pf=f1^10 f3^1 yields the exactmatch result on top > 100% of the time. > > Why I am seeing this behavior. > > is there anyway to say qf=f1 on the interface and get only exact results if > present (in this case though f1 is string but the q parameter has spaces. do > I need to use pf field > I am using dismax query parser. > > Thanks > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/string-field-does-not-yield-exact-match-result-using-qf-parameter-tp4060096.html > Sent from the Solr - User mailing list archive at Nabble.com.