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 Pooja Verlani <po...@gmail.com> on 2008/12/11 14:31:44 UTC

Dynamic Boosting at query time with boost value as another fieldvalue

Hi all,

I have a specific requirement for query time boosting.
I have to boost a field on the basis of the value returned from one of the
fields of the document.

Basically, I have the creationDate for a document and in order to introduce
recency factor in the search, i need to give a boost to the creation field,
where the boost value is something like a log(1/x) function and x is the
(presentDate - creationDate).
Till now what I have seen is we can give only a static boost to the
documents.

In case you can provide a solution to my problem.. please do reply :)

Thanks a lot,
Regards.
Pooja

Re: Dynamic Boosting at query time with boost value as another fieldvalue

Posted by Pooja Verlani <po...@gmail.com>.
Hi,

Will this currentDate work with epoch time only or can work with any date
format as specified by the "simpleDateFormat" class of Java ??

Thank you,
Regards,
Pooja

On Thu, Dec 11, 2008 at 7:20 PM, Shalin Shekhar Mangar <
shalinmangar@gmail.com> wrote:

> Take a look at FunctionQuery support in Solr:
>
> http://wiki.apache.org/solr/FunctionQuery
>
> http://wiki.apache.org/solr/SolrRelevancyFAQ#head-b1b1cdedcb9cd9bfd9c994709b4d7e540359b1fd
>
> On Thu, Dec 11, 2008 at 7:01 PM, Pooja Verlani <pooja.verlani@gmail.com
> >wrote:
>
> > Hi all,
> >
> > I have a specific requirement for query time boosting.
> > I have to boost a field on the basis of the value returned from one of
> the
> > fields of the document.
> >
> > Basically, I have the creationDate for a document and in order to
> introduce
> > recency factor in the search, i need to give a boost to the creation
> field,
> > where the boost value is something like a log(1/x) function and x is the
> > (presentDate - creationDate).
> > Till now what I have seen is we can give only a static boost to the
> > documents.
> >
> > In case you can provide a solution to my problem.. please do reply :)
> >
> > Thanks a lot,
> > Regards.
> > Pooja
> >
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: Dynamic Boosting at query time with boost value as another fieldvalue

Posted by Chris Hostetter <ho...@fucit.org>.
: ohk.. that means I can't use colon in the fieldname ever in such a scenario
: ?

In most internals, the lucene/solr code base allows *any* character in the 
field name, so you *can* use colons in field names, but many of the 
"surface" features (like the query parser) treat colon's as special 
characters, so in *some* situations colons don't work in field names.


-Hoss


Re: Dynamic Boosting at query time with boost value as another fieldvalue

Posted by Akshay <ak...@gmail.com>.
On Mon, Dec 15, 2008 at 12:36 PM, Pooja Verlani <po...@gmail.com>wrote:

> ohk.. that means I can't use colon in the fieldname ever in such a scenario
> ?

probably we can use colon in fieldname.
are you using the special keyword "_val_" for recip function query?
http://wiki.apache.org/solr/FunctionQuery#head-df0601b9306c8f2906ce91d3904bcd9621e02c99
http://wiki.apache.org/solr/SolrQuerySyntax


>
> On Mon, Dec 15, 2008 at 12:24 PM, Akshay <ak...@gmail.com> wrote:
>
> > The colon is used to specify value for a field. E.g. in the query box of
> > solr admin you would type something like fieldName:<string to search>
> > (title:Java). You can use hypen '-' or some other character in the field
> > name instead of colon.
> >
> > On Mon, Dec 15, 2008 at 12:11 PM, Pooja Verlani <pooja.verlani@gmail.com
> > >wrote:
> >
> > > hi,
> > > Is it possible to have a fieldname with colon for example
> "source:site"?
> > I
> > > want to apply query time boost as per recency to this field with the
> > > recency
> > > function.
> > > Recip function with rord isn't taking my source:site fieldname, its
> > > throwing
> > > an exception. I have tried with escape characters too.
> > > Please suggest something.
> > >
> > > Thank you,
> > > Regards
> > > Pooja
> > >
> > > On Thu, Dec 11, 2008 at 7:20 PM, Shalin Shekhar Mangar <
> > > shalinmangar@gmail.com> wrote:
> > >
> > > > Take a look at FunctionQuery support in Solr:
> > > >
> > > > http://wiki.apache.org/solr/FunctionQuery
> > > >
> > > >
> > >
> >
> http://wiki.apache.org/solr/SolrRelevancyFAQ#head-b1b1cdedcb9cd9bfd9c994709b4d7e540359b1fd
> > > >
> > > > On Thu, Dec 11, 2008 at 7:01 PM, Pooja Verlani <
> > pooja.verlani@gmail.com
> > > > >wrote:
> > > >
> > > > > Hi all,
> > > > >
> > > > > I have a specific requirement for query time boosting.
> > > > > I have to boost a field on the basis of the value returned from one
> > of
> > > > the
> > > > > fields of the document.
> > > > >
> > > > > Basically, I have the creationDate for a document and in order to
> > > > introduce
> > > > > recency factor in the search, i need to give a boost to the
> creation
> > > > field,
> > > > > where the boost value is something like a log(1/x) function and x
> is
> > > the
> > > > > (presentDate - creationDate).
> > > > > Till now what I have seen is we can give only a static boost to the
> > > > > documents.
> > > > >
> > > > > In case you can provide a solution to my problem.. please do reply
> :)
> > > > >
> > > > > Thanks a lot,
> > > > > Regards.
> > > > > Pooja
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Regards,
> > > > Shalin Shekhar Mangar.
> > > >
> > >
> >
> >
> >
> > --
> > Regards,
> > Akshay Ukey.
> >
>



-- 
Regards,
Akshay Ukey.

Re: Dynamic Boosting at query time with boost value as another fieldvalue

Posted by Pooja Verlani <po...@gmail.com>.
ohk.. that means I can't use colon in the fieldname ever in such a scenario
?

On Mon, Dec 15, 2008 at 12:24 PM, Akshay <ak...@gmail.com> wrote:

> The colon is used to specify value for a field. E.g. in the query box of
> solr admin you would type something like fieldName:<string to search>
> (title:Java). You can use hypen '-' or some other character in the field
> name instead of colon.
>
> On Mon, Dec 15, 2008 at 12:11 PM, Pooja Verlani <pooja.verlani@gmail.com
> >wrote:
>
> > hi,
> > Is it possible to have a fieldname with colon for example "source:site"?
> I
> > want to apply query time boost as per recency to this field with the
> > recency
> > function.
> > Recip function with rord isn't taking my source:site fieldname, its
> > throwing
> > an exception. I have tried with escape characters too.
> > Please suggest something.
> >
> > Thank you,
> > Regards
> > Pooja
> >
> > On Thu, Dec 11, 2008 at 7:20 PM, Shalin Shekhar Mangar <
> > shalinmangar@gmail.com> wrote:
> >
> > > Take a look at FunctionQuery support in Solr:
> > >
> > > http://wiki.apache.org/solr/FunctionQuery
> > >
> > >
> >
> http://wiki.apache.org/solr/SolrRelevancyFAQ#head-b1b1cdedcb9cd9bfd9c994709b4d7e540359b1fd
> > >
> > > On Thu, Dec 11, 2008 at 7:01 PM, Pooja Verlani <
> pooja.verlani@gmail.com
> > > >wrote:
> > >
> > > > Hi all,
> > > >
> > > > I have a specific requirement for query time boosting.
> > > > I have to boost a field on the basis of the value returned from one
> of
> > > the
> > > > fields of the document.
> > > >
> > > > Basically, I have the creationDate for a document and in order to
> > > introduce
> > > > recency factor in the search, i need to give a boost to the creation
> > > field,
> > > > where the boost value is something like a log(1/x) function and x is
> > the
> > > > (presentDate - creationDate).
> > > > Till now what I have seen is we can give only a static boost to the
> > > > documents.
> > > >
> > > > In case you can provide a solution to my problem.. please do reply :)
> > > >
> > > > Thanks a lot,
> > > > Regards.
> > > > Pooja
> > > >
> > >
> > >
> > >
> > > --
> > > Regards,
> > > Shalin Shekhar Mangar.
> > >
> >
>
>
>
> --
> Regards,
> Akshay Ukey.
>

Re: Dynamic Boosting at query time with boost value as another fieldvalue

Posted by Akshay <ak...@gmail.com>.
The colon is used to specify value for a field. E.g. in the query box of
solr admin you would type something like fieldName:<string to search>
(title:Java). You can use hypen '-' or some other character in the field
name instead of colon.

On Mon, Dec 15, 2008 at 12:11 PM, Pooja Verlani <po...@gmail.com>wrote:

> hi,
> Is it possible to have a fieldname with colon for example "source:site"? I
> want to apply query time boost as per recency to this field with the
> recency
> function.
> Recip function with rord isn't taking my source:site fieldname, its
> throwing
> an exception. I have tried with escape characters too.
> Please suggest something.
>
> Thank you,
> Regards
> Pooja
>
> On Thu, Dec 11, 2008 at 7:20 PM, Shalin Shekhar Mangar <
> shalinmangar@gmail.com> wrote:
>
> > Take a look at FunctionQuery support in Solr:
> >
> > http://wiki.apache.org/solr/FunctionQuery
> >
> >
> http://wiki.apache.org/solr/SolrRelevancyFAQ#head-b1b1cdedcb9cd9bfd9c994709b4d7e540359b1fd
> >
> > On Thu, Dec 11, 2008 at 7:01 PM, Pooja Verlani <pooja.verlani@gmail.com
> > >wrote:
> >
> > > Hi all,
> > >
> > > I have a specific requirement for query time boosting.
> > > I have to boost a field on the basis of the value returned from one of
> > the
> > > fields of the document.
> > >
> > > Basically, I have the creationDate for a document and in order to
> > introduce
> > > recency factor in the search, i need to give a boost to the creation
> > field,
> > > where the boost value is something like a log(1/x) function and x is
> the
> > > (presentDate - creationDate).
> > > Till now what I have seen is we can give only a static boost to the
> > > documents.
> > >
> > > In case you can provide a solution to my problem.. please do reply :)
> > >
> > > Thanks a lot,
> > > Regards.
> > > Pooja
> > >
> >
> >
> >
> > --
> > Regards,
> > Shalin Shekhar Mangar.
> >
>



-- 
Regards,
Akshay Ukey.

Re: Dynamic Boosting at query time with boost value as another fieldvalue

Posted by Pooja Verlani <po...@gmail.com>.
hi,
Is it possible to have a fieldname with colon for example "source:site"? I
want to apply query time boost as per recency to this field with the recency
function.
Recip function with rord isn't taking my source:site fieldname, its throwing
an exception. I have tried with escape characters too.
Please suggest something.

Thank you,
Regards
Pooja

On Thu, Dec 11, 2008 at 7:20 PM, Shalin Shekhar Mangar <
shalinmangar@gmail.com> wrote:

> Take a look at FunctionQuery support in Solr:
>
> http://wiki.apache.org/solr/FunctionQuery
>
> http://wiki.apache.org/solr/SolrRelevancyFAQ#head-b1b1cdedcb9cd9bfd9c994709b4d7e540359b1fd
>
> On Thu, Dec 11, 2008 at 7:01 PM, Pooja Verlani <pooja.verlani@gmail.com
> >wrote:
>
> > Hi all,
> >
> > I have a specific requirement for query time boosting.
> > I have to boost a field on the basis of the value returned from one of
> the
> > fields of the document.
> >
> > Basically, I have the creationDate for a document and in order to
> introduce
> > recency factor in the search, i need to give a boost to the creation
> field,
> > where the boost value is something like a log(1/x) function and x is the
> > (presentDate - creationDate).
> > Till now what I have seen is we can give only a static boost to the
> > documents.
> >
> > In case you can provide a solution to my problem.. please do reply :)
> >
> > Thanks a lot,
> > Regards.
> > Pooja
> >
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: Dynamic Boosting at query time with boost value as another fieldvalue

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Take a look at FunctionQuery support in Solr:

http://wiki.apache.org/solr/FunctionQuery
http://wiki.apache.org/solr/SolrRelevancyFAQ#head-b1b1cdedcb9cd9bfd9c994709b4d7e540359b1fd

On Thu, Dec 11, 2008 at 7:01 PM, Pooja Verlani <po...@gmail.com>wrote:

> Hi all,
>
> I have a specific requirement for query time boosting.
> I have to boost a field on the basis of the value returned from one of the
> fields of the document.
>
> Basically, I have the creationDate for a document and in order to introduce
> recency factor in the search, i need to give a boost to the creation field,
> where the boost value is something like a log(1/x) function and x is the
> (presentDate - creationDate).
> Till now what I have seen is we can give only a static boost to the
> documents.
>
> In case you can provide a solution to my problem.. please do reply :)
>
> Thanks a lot,
> Regards.
> Pooja
>



-- 
Regards,
Shalin Shekhar Mangar.