You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Joe Calderon <ca...@gmail.com> on 2009/12/29 19:59:16 UTC

boosting on string distance

hello *, i want to boost documents that match the query better,
currently i also index my field as a string an boost if i match the
string field

but im wondering if its possible to boost with bf parameter with a
formula using the function strdist(), i know one of the columns would
be the field name, but how do i specify the use query as the other
parameter?

http://wiki.apache.org/solr/FunctionQuery#strdist


best,

--joe

Re: boosting on string distance

Posted by Grant Ingersoll <gs...@gmail.com>.
On Dec 29, 2009, at 1:59 PM, Joe Calderon wrote:

> hello *, i want to boost documents that match the query better,
> currently i also index my field as a string an boost if i match the
> string field
> 
> but im wondering if its possible to boost with bf parameter with a
> formula using the function strdist(), i know one of the columns would
> be the field name, but how do i specify the use query as the other
> parameter?
> 
> http://wiki.apache.org/solr/FunctionQuery#strdist

You can just quote the Query, as in strdist("user query", field)

I guess it is a bit more complicated if you have operators in there, so you probably need to do some processing on the client side.

Is that what you are after? 

You could also use the fuzzy query and forego a function query altogether, although that only allows for edit distance.  Or, if you are simply indexing the field as a string, just do a regular term query match against it with your whole query as a single field and then boost that clause in the query.



-Grant