Boost Single Values in Field

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Boost Single Values in Field

JensBurkhardt
Hey,

I'm wondering if you can boost single values and not the whole field.
For example:
i'm having a field called test with "value1 value2 value3" - all packed in a String - and
i want to boost specific values e.g value1^0.5 value2^1.5 etc.
The problem is that i can't seperate this field. I don't think this will work but maybe someone has had the
same problem.
Trying to search took me nowhere :-) so i decided to just ask and maybe i'm lucky.

Greetings
Jens
Reply | Threaded
Open this post in threaded view
|

Re: Boost Single Values in Field

Grant Ingersoll-2
You have two options:

1. Boost the term on the query side.  The query parser pretty much  
takes exactly the syntax you use.
2. Use Payloads along with the BoostingTermQuery.

Search the archives for info on one or both.

-Grant

On Feb 20, 2008, at 11:30 AM, JensBurkhardt wrote:

>
> Hey,
>
> I'm wondering if you can boost single values and not the whole field.
> For example:
> i'm having a field called test with "value1 value2 value3" - all  
> packed in a
> String - and
> i want to boost specific values e.g value1^0.5 value2^1.5 etc.
> The problem is that i can't seperate this field. I don't think this  
> will
> work but maybe someone has had the
> same problem.
> Trying to search took me nowhere :-) so i decided to just ask and  
> maybe i'm
> lucky.
>
> Greetings
> Jens
> --
> View this message in context: http://www.nabble.com/Boost-Single-Values-in-Field-tp15591373p15591373.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>




--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com
http://www.lucenebootcamp.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Boost Single Values in Field

JensBurkhardt
This post was updated on .
Hello again,

Thanks for your immediate response. As i understand, the only way to boost the values is on query side, right?
The Problem is, that i need to boost the field values. Some more details:
I need it for a library. The string in the field i'm working with is something like "Title author year_of_publication some_catchwords" and so on. It's like one big String.
This field is called "Free-Text" so the query can be something like "author AND title".
And that's the point, the order of the search terms is arbitrary so i don't know what i do boost in the field. If i want to boost the title i need to boost the specific value in the Free-Text field.
If I'm wrong and i can handle this problem with using payload, could someone please explain it cause i don't understand how to use payload on index side.

Best regards
Jens

Grant Ingersoll-6 wrote
You have two options:

1. Boost the term on the query side.  The query parser pretty much  
takes exactly the syntax you use.
2. Use Payloads along with the BoostingTermQuery.

Search the archives for info on one or both.

-Grant

On Feb 20, 2008, at 11:30 AM, JensBurkhardt wrote:

>
> Hey,
>
> I'm wondering if you can boost single values and not the whole field.
> For example:
> i'm having a field called test with "value1 value2 value3" - all  
> packed in a
> String - and
> i want to boost specific values e.g value1^0.5 value2^1.5 etc.
> The problem is that i can't seperate this field. I don't think this  
> will
> work but maybe someone has had the
> same problem.
> Trying to search took me nowhere :-) so i decided to just ask and  
> maybe i'm
> lucky.
>
> Greetings
> Jens
> --
> View this message in context: http://www.nabble.com/Boost-Single-Values-in-Field-tp15591373p15591373.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>




--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com
http://www.lucenebootcamp.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ





---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Reply | Threaded
Open this post in threaded view
|

Re: Boost Single Values in Field

Grant Ingersoll-2

On Feb 21, 2008, at 6:53 AM, JensBurkhardt wrote:

>
> Hello again,
>
> Thanks for your immediate response. As i understand, the only way to  
> boost
> the values is on query side, right?
> The Problem is, that i need to boost field values. Okay, some more  
> details:
> I need it for a library. The string in the field i'm working with is
> something like "Title author year_of_publication some_catchwords"  
> and so on.
> It's like on big String.
> This field is called "Free-Text" so the query can something like  
> "author AND
> title".
> And that's the point, the order of the search terms is arbitrary so  
> i don't
> know what i do boost in the field. If i want to boost the title i  
> need to
> boost the specific value in the Free-Text field.
> If I'm wrong and i can handle this problem with using payload, could  
> someone
> please explain it cause i don't understand how to use payload on  
> index side.
>

I would split the string (either ahead of time or by writing your own  
TeeTokenFilter and SinkTokenizer) such that you can separate out your  
one big String into two smaller fields.  Other option, is to use  
payloads

Token.setPayload() is how you set payloads.  There are a couple  
examples in 2.3 in the contrib/analysis package of how to add payloads  
for specific things, you would just need your own that recognized your  
structure.

Also have a look at Michael B's excellent ApacheCon slides: http://people.apache.org/~buschmi/apachecon/AdvancedIndexingLuceneAtlanta07.ppt

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Boost Single Values in Field

JensBurkhardt
Okay, Thanks a lot for answering my questions. I'll give the split string thing a try :-) .

Best Regards

Jens Burkhardt


Grant Ingersoll-6 wrote
On Feb 21, 2008, at 6:53 AM, JensBurkhardt wrote:
>
> Hello again,
>
> Thanks for your immediate response. As i understand, the only way to  
> boost
> the values is on query side, right?
> The Problem is, that i need to boost field values. Okay, some more  
> details:
> I need it for a library. The string in the field i'm working with is
> something like "Title author year_of_publication some_catchwords"  
> and so on.
> It's like on big String.
> This field is called "Free-Text" so the query can something like  
> "author AND
> title".
> And that's the point, the order of the search terms is arbitrary so  
> i don't
> know what i do boost in the field. If i want to boost the title i  
> need to
> boost the specific value in the Free-Text field.
> If I'm wrong and i can handle this problem with using payload, could  
> someone
> please explain it cause i don't understand how to use payload on  
> index side.
>

I would split the string (either ahead of time or by writing your own  
TeeTokenFilter and SinkTokenizer) such that you can separate out your  
one big String into two smaller fields.  Other option, is to use  
payloads

Token.setPayload() is how you set payloads.  There are a couple  
examples in 2.3 in the contrib/analysis package of how to add payloads  
for specific things, you would just need your own that recognized your  
structure.

Also have a look at Michael B's excellent ApacheCon slides: http://people.apache.org/~buschmi/apachecon/AdvancedIndexingLuceneAtlanta07.ppt

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org