Hi everyone,

I index my data from the DB into their own fields.  I then use copyField to
index the value of all the fields into _ALL_FIELDS_ that I created.  In my
edismax, I use _ALL_FIELDS_ for “df”.  Here is how my edismax looks like:



    <lst name="defaults">
      <str name="echoParams">explicit</str>
      <str name="defType">edismax</str>
      <str name="q.alt">*:*</str>
      <str name="q.op">AND</str>
      <str name="fl">score,_UNIQUE_FIELD_</str>
      <str name="df">_ALL_FIELDS_</str>
      <!-- <str name="qf">_ALL_FIELDS_</str> --> <!-- use "qf" or "df" -->

      <str name="lowercaseOperators">false</str>
    </lst>

One of my fields that I index is called ID (every record I index has this
field) and it holds the user-friendly record-ID that uniquely identifies
that record (users are familiar with the value of this ID field).  The
value of this ID field can be in any other record's field too but only 1
record in the whole set has this value in the ID field.  An example of a
value for ID is “MOD00002012A".

My need is achieve both of those goals (A is a must but B is highly
desired):


A) If a user searches for just "MOD00002012A" (with our without quotes) I
want the record that matches this value in the ID field to be the first
item in the hit result regardless where else this term may also exist in
other records: the record with ID "MOD00002012A" must be hit #1 on the list.

B) If a user searches for "MOD00002012A manual" or "download MOD00002012A
manual" or "factory warranty for MOD00002012A", etc. (without quotes) I
want the record that matches this value in the ID field to be the first
item in the hit result regardless where else this term may also exist in
other records: the record with ID "MOD00002012A" must be hit #1 on the list.

How can I achieve A and B?



Of course, if “MOD00002012A” does not match in the ID field but matches in
another field, then I need the normal search / hit / ranking to happen.


As a side question, what should I be using, "qf" or "df"?  I cannot figure
out the difference between the 2 in Solr's doc.

Thanks

Steven

Reply via email to