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 Andrea Gazzarini <an...@atcult.it> on 2010/10/19 16:23:46 UTC

Re: **SPAM** Re: boosting injection

Hi Ken, 
thanks for your response...unfortunately it doesn't solve my problem.

I cannot chnage the client behaviour so the query must be a query and not only the query terms.
In this scenario, It would be great, for example, if I could declare the boost in the schema field definition....but I think it's not possible isn't it?

Regards
Andrea 
  _____  

From: Ken Stanley [mailto:dohpaz@gmail.com]
To: solr-user@lucene.apache.org
Sent: Tue, 19 Oct 2010 15:05:31 +0200
Subject: **SPAM**  Re: boosting injection

Andrea,
  
  Using the SOLR dismax query handler, you could set up queries like this to
  boost on fields of your choice. Basically, the q parameter would be the
  query terms (without the field definitions, and a qf (Query Fields)
  parameter that you use to define your boost(s):
  http://wiki.apache.org/solr/DisMaxQParserPlugin. A non-SOLR alternative
  would be to parse the query in whatever application is sending the queries
  to the SOLR instance to make the necessary transformations.
  
  Regards,
  
  Ken
  
  It looked like something resembling white marble, which was
  probably what it was: something resembling white marble.
                  -- Douglas Adams, "The Hitchhikers Guide to the Galaxy"
  
  
  On Tue, Oct 19, 2010 at 8:48 AM, Andrea Gazzarini <
  andrea.gazzarini@atcult.it> wrote:
  
  >  Hi all,
  > I have a client that is sending this query
  >
  > q=title:history AND author:joyce
  >
  > is it possible to "transform" at runtime this query in this way:
  >
  > q=title:history^10 AND author:joyce^5
  >
  > ?
  >
  > Best regards,
  > Andrea
  >
  >
  >
    

Re: boosting injection

Posted by Andrea Gazzarini <an...@atcult.it>.
      Hi Ken,
yes I'm a java developer so I think I should be able to do that but I 
was wondering if there's a way to solve my issue without coding.
Problem is that I need to adjust this query in a short time and in 
addition I cannot justify (at this stage of the project) additional 
software artifacts.

Anyway thanks for your support

Best Regards,
Andrea

Il 19/10/2010 16:33, Ken Stanley ha scritto:
> Andrea,
>
> Another approach, aside of Markus' suggestion, would be to create your own
> handler that could intercept the query and perform whatever necessary
> transformations that you need at query time. However, that would require
> having Java knowledge (which I make no assumption).
>
> Regards,
>
> Ken
>
> It looked like something resembling white marble, which was
> probably what it was: something resembling white marble.
>                  -- Douglas Adams, "The Hitchhikers Guide to the Galaxy"
>
>
> On Tue, Oct 19, 2010 at 10:23 AM, Andrea Gazzarini<
> andrea.gazzarini@atcult.it>  wrote:
>
>>   Hi Ken,
>> thanks for your response...unfortunately it doesn't solve my problem.
>>
>> I cannot chnage the client behaviour so the query must be a query and not
>> only the query terms.
>> In this scenario, It would be great, for example, if I could declare the
>> boost in the schema field definition....but I think it's not possible isn't
>> it?
>>
>> Regards
>> Andrea
>>
>> ------------------------------
>> *From:* Ken Stanley [mailto:dohpaz@gmail.com]
>> *To:* solr-user@lucene.apache.org
>> *Sent:* Tue, 19 Oct 2010 15:05:31 +0200
>> *Subject:* **SPAM** Re: boosting injection
>>
>> Andrea,
>>
>> Using the SOLR dismax query handler, you could set up queries like this to
>> boost on fields of your choice. Basically, the q parameter would be the
>> query terms (without the field definitions, and a qf (Query Fields)
>> parameter that you use to define your boost(s):
>> http://wiki.apache.org/solr/DisMaxQParserPlugin. A non-SOLR alternative
>> would be to parse the query in whatever application is sending the queries
>> to the SOLR instance to make the necessary transformations.
>>
>> Regards,
>>
>> Ken
>>
>> It looked like something resembling white marble, which was
>> probably what it was: something resembling white marble.
>> -- Douglas Adams, "The Hitchhikers Guide to the Galaxy"
>>
>>
>> On Tue, Oct 19, 2010 at 8:48 AM, Andrea Gazzarini<
>> andrea.gazzarini@atcult.it>  wrote:
>>
>>> Hi all,
>>> I have a client that is sending this query
>>>
>>> q=title:history AND author:joyce
>>>
>>> is it possible to "transform" at runtime this query in this way:
>>>
>>> q=title:history^10 AND author:joyce^5
>>>
>>> ?
>>>
>>> Best regards,
>>> Andrea
>>>
>>>
>>>
>>

Re: **SPAM** Re: boosting injection

Posted by Ken Stanley <do...@gmail.com>.
Andrea,

Another approach, aside of Markus' suggestion, would be to create your own
handler that could intercept the query and perform whatever necessary
transformations that you need at query time. However, that would require
having Java knowledge (which I make no assumption).

Regards,

Ken

It looked like something resembling white marble, which was
probably what it was: something resembling white marble.
                -- Douglas Adams, "The Hitchhikers Guide to the Galaxy"


On Tue, Oct 19, 2010 at 10:23 AM, Andrea Gazzarini <
andrea.gazzarini@atcult.it> wrote:

>  Hi Ken,
> thanks for your response...unfortunately it doesn't solve my problem.
>
> I cannot chnage the client behaviour so the query must be a query and not
> only the query terms.
> In this scenario, It would be great, for example, if I could declare the
> boost in the schema field definition....but I think it's not possible isn't
> it?
>
> Regards
> Andrea
>
> ------------------------------
> *From:* Ken Stanley [mailto:dohpaz@gmail.com]
> *To:* solr-user@lucene.apache.org
> *Sent:* Tue, 19 Oct 2010 15:05:31 +0200
> *Subject:* **SPAM** Re: boosting injection
>
> Andrea,
>
> Using the SOLR dismax query handler, you could set up queries like this to
> boost on fields of your choice. Basically, the q parameter would be the
> query terms (without the field definitions, and a qf (Query Fields)
> parameter that you use to define your boost(s):
> http://wiki.apache.org/solr/DisMaxQParserPlugin. A non-SOLR alternative
> would be to parse the query in whatever application is sending the queries
> to the SOLR instance to make the necessary transformations.
>
> Regards,
>
> Ken
>
> It looked like something resembling white marble, which was
> probably what it was: something resembling white marble.
> -- Douglas Adams, "The Hitchhikers Guide to the Galaxy"
>
>
> On Tue, Oct 19, 2010 at 8:48 AM, Andrea Gazzarini <
> andrea.gazzarini@atcult.it> wrote:
>
> > Hi all,
> > I have a client that is sending this query
> >
> > q=title:history AND author:joyce
> >
> > is it possible to "transform" at runtime this query in this way:
> >
> > q=title:history^10 AND author:joyce^5
> >
> > ?
> >
> > Best regards,
> > Andrea
> >
> >
> >
>
>

Re: boosting injection

Posted by Erick Erickson <er...@gmail.com>.
The main disadvantage of index-time boosting is that you must reindex your
corpus entirely if you want to alter the boost factors. And there's no very
good
way to anticipate what boost factors will give you the results you want....

I wonder if you could cheat and do some basic string processing on the
query and add your boosts? That's be tricky unless you have very predictable
strings....

Best
Erick

On Tue, Oct 19, 2010 at 10:33 AM, Andrea Gazzarini <
andrea.gazzarini@atcult.it> wrote:

>   Y-E-A-H! I think it's so!
> Markus, what are disadvantages of this boosting strategy?
>
> Thanks a lot
> Andrea
>
> Il 19/10/2010 16:25, Markus Jelsma ha scritto:
>
>> Index-time boosting maybe?
>>
>> http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22field.22
>>
>>
>> On Tuesday, October 19, 2010 04:23:46 pm Andrea Gazzarini wrote:
>>
>>> Hi Ken,
>>> thanks for your response...unfortunately it doesn't solve my problem.
>>>
>>> I cannot chnage the client behaviour so the query must be a query and not
>>> only the query terms. In this scenario, It would be great, for example,
>>> if
>>> I could declare the boost in the schema field definition....but I think
>>> it's not possible isn't it?
>>>
>>> Regards
>>> Andrea
>>>   _____
>>>
>>> From: Ken Stanley [mailto:dohpaz@gmail.com]
>>> To: solr-user@lucene.apache.org
>>> Sent: Tue, 19 Oct 2010 15:05:31 +0200
>>> Subject: **SPAM**  Re: boosting injection
>>>
>>> Andrea,
>>>
>>>   Using the SOLR dismax query handler, you could set up queries like this
>>> to boost on fields of your choice. Basically, the q parameter would be
>>> the
>>> query terms (without the field definitions, and a qf (Query Fields)
>>> parameter that you use to define your boost(s):
>>>   http://wiki.apache.org/solr/DisMaxQParserPlugin. A non-SOLR
>>> alternative
>>>   would be to parse the query in whatever application is sending the
>>> queries to the SOLR instance to make the necessary transformations.
>>>
>>>   Regards,
>>>
>>>   Ken
>>>
>>>   It looked like something resembling white marble, which was
>>>   probably what it was: something resembling white marble.
>>>                   -- Douglas Adams, "The Hitchhikers Guide to the Galaxy"
>>>
>>>
>>>   On Tue, Oct 19, 2010 at 8:48 AM, Andrea Gazzarini<
>>>
>>>   andrea.gazzarini@atcult.it>  wrote:
>>>   >   Hi all,
>>>   >
>>>   >  I have a client that is sending this query
>>>   >
>>>   >  q=title:history AND author:joyce
>>>   >
>>>   >  is it possible to "transform" at runtime this query in this way:
>>>   >
>>>   >  q=title:history^10 AND author:joyce^5
>>>   >
>>>   >  ?
>>>   >
>>>   >  Best regards,
>>>   >  Andrea
>>>
>>

Re: boosting injection

Posted by Andrea Gazzarini <an...@atcult.it>.
    Y-E-A-H! I think it's so!
Markus, what are disadvantages of this boosting strategy?

Thanks a lot
Andrea

Il 19/10/2010 16:25, Markus Jelsma ha scritto:
> Index-time boosting maybe?
> http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22field.22
>
> On Tuesday, October 19, 2010 04:23:46 pm Andrea Gazzarini wrote:
>> Hi Ken,
>> thanks for your response...unfortunately it doesn't solve my problem.
>>
>> I cannot chnage the client behaviour so the query must be a query and not
>> only the query terms. In this scenario, It would be great, for example, if
>> I could declare the boost in the schema field definition....but I think
>> it's not possible isn't it?
>>
>> Regards
>> Andrea
>>    _____
>>
>> From: Ken Stanley [mailto:dohpaz@gmail.com]
>> To: solr-user@lucene.apache.org
>> Sent: Tue, 19 Oct 2010 15:05:31 +0200
>> Subject: **SPAM**  Re: boosting injection
>>
>> Andrea,
>>
>>    Using the SOLR dismax query handler, you could set up queries like this
>> to boost on fields of your choice. Basically, the q parameter would be the
>> query terms (without the field definitions, and a qf (Query Fields)
>> parameter that you use to define your boost(s):
>>    http://wiki.apache.org/solr/DisMaxQParserPlugin. A non-SOLR alternative
>>    would be to parse the query in whatever application is sending the
>> queries to the SOLR instance to make the necessary transformations.
>>
>>    Regards,
>>
>>    Ken
>>
>>    It looked like something resembling white marble, which was
>>    probably what it was: something resembling white marble.
>>                    -- Douglas Adams, "The Hitchhikers Guide to the Galaxy"
>>
>>
>>    On Tue, Oct 19, 2010 at 8:48 AM, Andrea Gazzarini<
>>
>>    andrea.gazzarini@atcult.it>  wrote:
>>    >   Hi all,
>>    >
>>    >  I have a client that is sending this query
>>    >
>>    >  q=title:history AND author:joyce
>>    >
>>    >  is it possible to "transform" at runtime this query in this way:
>>    >
>>    >  q=title:history^10 AND author:joyce^5
>>    >
>>    >  ?
>>    >
>>    >  Best regards,
>>    >  Andrea

Re: **SPAM** Re: boosting injection

Posted by Markus Jelsma <ma...@openindex.io>.
Index-time boosting maybe?
http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22field.22

On Tuesday, October 19, 2010 04:23:46 pm Andrea Gazzarini wrote:
> Hi Ken,
> thanks for your response...unfortunately it doesn't solve my problem.
> 
> I cannot chnage the client behaviour so the query must be a query and not
> only the query terms. In this scenario, It would be great, for example, if
> I could declare the boost in the schema field definition....but I think
> it's not possible isn't it?
> 
> Regards
> Andrea
>   _____
> 
> From: Ken Stanley [mailto:dohpaz@gmail.com]
> To: solr-user@lucene.apache.org
> Sent: Tue, 19 Oct 2010 15:05:31 +0200
> Subject: **SPAM**  Re: boosting injection
> 
> Andrea,
> 
>   Using the SOLR dismax query handler, you could set up queries like this
> to boost on fields of your choice. Basically, the q parameter would be the
> query terms (without the field definitions, and a qf (Query Fields)
> parameter that you use to define your boost(s):
>   http://wiki.apache.org/solr/DisMaxQParserPlugin. A non-SOLR alternative
>   would be to parse the query in whatever application is sending the
> queries to the SOLR instance to make the necessary transformations.
> 
>   Regards,
> 
>   Ken
> 
>   It looked like something resembling white marble, which was
>   probably what it was: something resembling white marble.
>                   -- Douglas Adams, "The Hitchhikers Guide to the Galaxy"
> 
> 
>   On Tue, Oct 19, 2010 at 8:48 AM, Andrea Gazzarini <
> 
>   andrea.gazzarini@atcult.it> wrote:
>   >  Hi all,
>   > 
>   > I have a client that is sending this query
>   > 
>   > q=title:history AND author:joyce
>   > 
>   > is it possible to "transform" at runtime this query in this way:
>   > 
>   > q=title:history^10 AND author:joyce^5
>   > 
>   > ?
>   > 
>   > Best regards,
>   > Andrea

-- 
Markus Jelsma - CTO - Openindex
http://www.linkedin.com/in/markus17
050-8536600 / 06-50258350