On 1/18/2013 8:52 AM, Walter Underwood wrote:

On Jan 17, 2013, at 10:53 PM, Shawn Heisey wrote:

On 1/17/2013 11:41 PM, Walter Underwood wrote:
As I understand it, the bq parameter is a full Lucene query, but only used for 
ranking, not for selection. This is the complement of fq.

You can use weighting:  provider:fred^8

This will be affected by idf, so providers with fewer matches will have higher 
weight than those with more matches. This is a bother, but the idf-free 
approach requires Solr 4.0.

I am doing my testing on Solr 4.1, so if you can give me the syntax for that, I 
would appreciate it.  My production indexes are 3.5, but once we are confident 
with the 4.1 dev system, we'll upgrade.

The provider field has omitTermFreqAndPositions="true" defined, but the fields 
that typically get searched don't omit anything, so IDF probably still applies in the 
aggregate.

On a related note, I have rather extreme length variation in my fields, so I 
see quite a lot of weird results due to very short metadata.  Is there any way 
to lessen the impact of lengthNorm without eliminating it entirely?  If not, is 
there any way to eliminate lengthNorm without also disabling index-time boosts? 
 At this moment I am not doing index-time boosting, but business requirements 
may change that in the future.

Thanks,
Shawn

I was experimenting with a boost function like this:

if(exists(query(provider:fred)), 5, 1)

That gives a constant boost if the term exists in the field, none if it does 
not. If you pass the provider in as a separate URL param, you could use 
parameter substitution.

if(exists(query(provider:$provider)), 5, 1)

For length norms, you could try a different similarity class or write your own, 
changing Similarity.computeNorm().

I tried a boost= parameter on my 4.1 server and got an error message in the response with the entire value of the parameter:

org.apache.solr.search.SyntaxError: Nested function query must use $param or {!v=value} forms. got 'if(exists(query(ip:sc)), 2, 1)'

I get a different error if I change it to bf instead of boost:

org.apache.solr.search.SyntaxError: Unexpected text after function: )

What am I doing wrong?

Thanks,
Shawn

Reply via email to