First, that a document is relevant to a query does not necessarily mean that
this document has to contain some query term. You can have other ways to
assert that a document is relevant to a query.
My IR model is different of the vector model, so it can to give score not
null for documents irrelevant for the vector model. I know that Lucene
implements the vector model, but I want to use the facilities of the Lucene
because I like what the Lucene provides.
But the Lucene to give scores only for relevant documents for the vector
model. And the my model can to give score same that this documents isn't
relevant to vector model. It depends of the configuration granularity of
execution.
So I liked that method nextDoc() of the class that implements the
Scorer.class returned all the documents the end of the iteration to
calculate the score.
I've got to calculate the customized score of the documents that Lucene
returns in according to the vector model.
I hope you have understood me!
Thanks!
On Tue, Aug 25, 2009 at 1:17 PM, Shai Erera wrote:
> Can you please elaborate more on the use case? Why if a certain document is
> irrelevant to a certain query, you'd like to give it a score? Are you
> perhaps talking about certain documents which should always appear in
> search
> results, no matter what the query is? And instead of always showing them,
> you'd like to give them a "static score", so that they can compete w/ other
> docs?
>
> If that's the case, I think you can use a BooleanQuery such that the user
> query is added as a clause and then you add another clause (MUST) which is
> in fact a MatchAllDocsQuery or something like that which returns a
> customized score. It's expensive though as for each query you'll score all
> docs in the index.
>
> But I don't think that will help (at least for this use case) since every
> relevant document to the query will be added the same score as an
> 'irrelevant' document, which means the relevant docs will still win, no?
>
> Shai
>
> 2009/8/25 Fabrício Raphael
>
> > I already know about this, but I want to give a customized score for all
> > documents in collection, independent if wache document is or isn't
> relevant
> > to the vector model.
> >
> > The similarity function is called only when the document is relevant to
> the
> > vector model.
> >
> > Do you understand me?
> >
> > Thanks!
> >
> > On Sat, Aug 22, 2009 at 2:28 AM, prashant ullegaddi <
> > prashullegaddi@gmail.com> wrote:
> >
> > > If you want to modify the way Lucene scores documents, I guess you need
> > to
> > > extend Similarity class and provide your own implementation. Take a
> look
> > > at:
> > >
> > >
> > >
> >
> http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/search/DefaultSimilarity.html
> > >
> > >
> >
> http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/search/Similarity.html
> > >
> > > Thanks,
> > > Prashant.
> > >
> > > 2009/8/21 Fabrício Raphael
> > >
> > > > How to give a customize score for all documents independent of the
> > vector
> > > > model?
> > > >
> > > > I already know how to give a customize score, but I want to give this
> > > > customize score for all documents in the collection, regardless of
> what
> > > is
> > > > relevant to the vector model.
> > > >
> > > > How to do this?
> > > >
> > > > Now, thanks!
> > > >
> > > > --
> > > > Fabrício Raphael
> > > >
> > >
> >
> >
> >
> > --
> > Fabrício Raphael
> >
>
--
Fabrício Raphael