-Re: Function Queries
Pieter Berkel 2007-08-17, 01:13
On 17/08/07, Yakn <[EMAIL PROTECTED]> wrote:
> One example is that if you have mm being blank in the solrConfig.xml
> and not commented out, then it will throw a NumberFormatException.
The required format of the mm field is described in more detail here:
The parser is pretty fussy about how this field is formatted, when a value
is not specified the default value is "100%" which means "match documents
that contain every term in the query".
Perhaps it might be a good idea to add a simple sanity check to mm testing
for empty string?
Another example is that without something in qf, then the query, using
dt=dismax in the query request string, does not return any results.
qf is a required parameter and is needed (in combination with q param) to
construct a Lucene query, it won't work without it (as you've discovered).
The default values in solrconfig.xml serve as an example and you'll most
probably need to change it to match your schema (the value in
solrconfig.xmlis only used if qf is not set in your request query
So, what I am really looking for here is the proper way to do the whole
> solrConfig.xml, for the dismax request handler. It seems that I am somehow
I think the whole point of the values set in the solrconfig.xml included
with the distribution are to serve as a guide for you to try with the
examples provided. In general most of these default values (that don't
refer to specific fields) can be left unmodified and dismax requests will
still work fine, however you can change and tweak these parameters to suit
your particular requirements if neccessary.
> The way that I understand it right now is this, for all
> the fields that will be searched on and a function query will be used,
> need to be in the qf parameter.
Only fields that you want to match terms in "q" need to be listed in "qf",
it is not necessary to list fields used in a function query there.
> For the function query itself, I have just a
> field called importancerank which is a float type field. I do not use
> or reord() or linear() etc... because I just want to take that value of
> field and add it to the score.
I haven't tried this myself but it should be as simple as adding the
following to your query string: bf=importancerank
> I also have a 0.01 in tie. I have echoParams
> set to explicit. These are the only parameters that I have set up. I have
> the rest commented out such as pf, ps, q.alt, and mm. Also, what is fl? I
> could not find any documentation on that.
A lot of parameters (including fl) are common and used by both Standard and
Dismax request handlers, so you should take a look at:
What happens currently for me is that when I put the dt=dismax parameter in
> my query request string, I get exactly the same results as if I didn't,
> meaning it didn't appear to sort it at all. What other parameters do I
to fill out in the request handler to make this work? What might I have done
> wrong in my thinking of how things work?
You'll have to provide more information about your query (e.g. query string
parameters, field definitions from schema.xml, list the contents of
<requestHandler name="dismax" class="solr.DisMaxRequestHandler"> in
solrconfig.xml) in order to see what's going on.
Another thing that would be helpful is to see a whole solrConfig schema for
> the dismax request handler. I have only
> read about bits of it and I think that to get a view of a full one that
> actually works would be very helpful. Thanks again.
This is the solrconfig.xml that I mentioned earlier, it is provided with the
Solr distribution (in /example/solr/conf/):
Hope this helps,