lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: Number Proximity Query
Date Wed, 04 Oct 2006 11:25:40 GMT
Sorry if this is a re-post, but I got an "undeliverable" error last time I
tried to post it, something about SPAM. The nerve of that filter!

----------------
I don't have my book handy, but you might want to check out "Lucene In
Action". There's an example of how to create an index of restaurants and
execute a query that orders the responses by the distance to the closest
restaurant.

I think a similar technique (although proabably an easier implementation)
could apply to your problem. Unfortunately, I don't remember the details
well enough to say much more....

Could you accomplish this by implementing your own sort? I have no real idea
whether that's applicable, but it did occur to me......

Not much help, but a start <G>.

Erick

On 10/4/06, KEGan <khoon.ee.gan@gmail.com> wrote:
>
> Thanks Chis.
>
> After spending half a day to "really" look into FunctionQuery (and related
> classes), and re-reading about Weight and Scorer. I think I am beginning
> to
> understand a bit. But more questions.
>
> (1) Should values returned by DocValues (return from ValueSource) must
> always betwen 1.0 and 0.0 ? How is this value affect the overall document
> scores, assuming there are others Query clauses as well that is perform on
> the document (on other fields).
>
> (2) The documentation on the following functions is extremely lacking (no
> matter where I looked). Any expert here can help out ?
>
> -- Weight.getValue() : what values should be returned for
> NumberProximityQuery?
> -- Weight.sumOfSquareWeights() : no idea what is this for???
> -- Weight.normalize() : still no idea
> -- Scorer.score() : should this value always between 1.0 and 0.0 ?
>
>
>
> Thanks.
> ~KEGan
>
>
> On 10/4/06, Chris Hostetter <hossman_lucene@fucit.org> wrote:
> >
> >
> > : >From my searches, there seems to be a FunctionQuery in Solr that can
> do
> > this
> > : type of query. But I am using pure Lucene, and trying to port Solr
> code
> > over
> > : (to create my own version of FunctionQuery) looks too complicated
> > because of
> > : code dependency on other Solr code such as ValueSource, etc.
> >
> > ValueSource isn't relaly "other Solr code" .. it's an inherient part of
> > FunctionQuery (hence it's in the same package).
> >
> > You should be able to use everything in the
> > org.apache.solr.search.function package as is without any other Solr
> code.
> >
> > : I have also search on how to write my own query instance, but there is
> > lack
> > : of documentation on doing so. The formula to calculate the number
> > proximity
> > : is quite trivial. But how to stitch together Query, Weight, Scorer is
> > the
> > : problem :(
> >
> > Check out the package documentation for org.apache.lucene.search,
> > particularly section #3 "Changing the Scoring" ...
> >
> >
> >
> http://lucene.apache.org/java/docs/api/org/apache/lucene/search/package-summary.html#scoring
> >
> >
> >
> >
> > -Hoss
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message