Hi guys -
So I am getting happier with search, and just pushed the lucene version live at:
http://www.theserverside.com (on the leftbar) and:
http://www.theserverside.com/home/search/index.jsp
The only real item that I still want to tweak more is getting recent results higher in the
list.
I was wondering if something like this could work (or if there is a better solution)
At index time, I have the date of the content. I could do some math where the higher the
date
(based on the time_t version or whatever) the more of a setBoost(metric). Or, for every month
in the
past, create a larger negative number to setBoost()... or something like that.
Would something like this make sense?
Dion
> -----Original Message-----
> From: Erik Hatcher [mailto:erik@ehatchersolutions.com]
> Sent: Sunday, November 23, 2003 3:52 PM
> To: Lucene Users List
> Subject: Re: Dates and others
>
> On Saturday, November 22, 2003, at 06:33 PM, Dion Almaer wrote:
> > 3. I have some fields suck as title, owner, etc as well as
> the content
> > blob which I index and use as the default search field. Is
> there an
> > easy way to extend the QueryParser to merge it with a
> MultiTermQuery
> > which can also search this meta data and give them certain
> weights?
> > Or, if you go down this path do you have to leave the QueryParser
> > behind and build your own queries? Any best practices
> would be great.
>
> And Ype said:
> You can provide field weights at document indexing time
> (norms) and use a MultiTermQuery for searching multiple
> fields. At query time you can again use field weights.
> I don't know how the scoring of the MultiTermQuery is done,
> it might use the max. score over the fields of a document, or
> combine the scores in the fields of a document.
> ---- end Ype's reply cut and paste
>
> I'm a little confused with this question and Ype's reply.
> MultiTermQuery is an abstract base class under Query, which
> is the parent for WildcardQuery and FuzzyQuery.
>
> What I think you're after is using MultiFieldQueryParser, but
> you want to weight the fields differently. You can add the
> boosts at indexing time using Field.setBoost. Unfortunately
> at the moment MultiFieldQueryParser is not very extensible -
> there are some open issues with its subclassability but
> subclassing MFQP and overriding getFieldQuery will do the
> trick when the subclassing issues are resolved allowing you
> to boost at query time.
>
> Making an educated guess at what you're doing with Lucene,
> Dion, I'd venture to say that boosting at indexing time is
> sufficient for your needs.
>
> Erik
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
|