List Info

Thread: RE: Forced Top Document




RE: Forced Top Document
country flaguser name
United States
2007-10-24 12:05:00
Do you know which document you want at the top? If so, I
believe you
could just add an "OR" clause to your query to
boost that document very
high, such as

?q=foo OR id:bar^1000

Tried this on my installation and it did, indeed push the
document
specified to the top. 



-----Original Message-----
From: Matthew Runo [mailto:mrunozappos.com] 
Sent: Wednesday, October 24, 2007 10:17 AM
To: solr-userlucene.apache.org
Subject: Re: Forced Top Document

I'd love to know this, as I just got a development request
for this  
very feature. I'd rather not spend time on it if it already
exists.

+--------------------------------------------------------+
  | Matthew Runo
  | Zappos Development
  | mrunozappos.com
  | 702-943-7833
+--------------------------------------------------------+


On Oct 23, 2007, at 10:12 PM, mark angelillo wrote:

> Hi all,
>
> Is there a way to get a specific document to appear on
top of  
> search results even if a sorting parameter would push
it further down?
>
> Thanks in advance,
> Mark
>
> mark angelillo
> snooth inc.
> o: 646.723.4328
> c: 484.437.9915
> marksnooth.com
> snooth -- 1.8 million ratings and counting...
>
>


Re: Forced Top Document
user name
2007-10-24 12:44:20
Charlie,

That's interesting. I did try something like this. Did you
try your  
query with a sorting parameter?

What I've read suggests that all the results are returned
based on  
the query specified, but then resorted as specified.
Boosting (which  
modifies the document's score) should not change the order
unless the  
results are sorted by score.

Mark

On Oct 24, 2007, at 1:05 PM, Charlie Jackson wrote:

> Do you know which document you want at the top? If so,
I believe you
> could just add an "OR" clause to your query
to boost that document  
> very
> high, such as
>
> ?q=foo OR id:bar^1000
>
> Tried this on my installation and it did, indeed push
the document
> specified to the top.
>
>
>
> -----Original Message-----
> From: Matthew Runo [mailto:mrunozappos.com]
> Sent: Wednesday, October 24, 2007 10:17 AM
> To: solr-userlucene.apache.org
> Subject: Re: Forced Top Document
>
> I'd love to know this, as I just got a development
request for this
> very feature. I'd rather not spend time on it if it
already exists.
>
>
+--------------------------------------------------------+
>   | Matthew Runo
>   | Zappos Development
>   | mrunozappos.com
>   | 702-943-7833
>
+--------------------------------------------------------+
>
>
> On Oct 23, 2007, at 10:12 PM, mark angelillo wrote:
>
>> Hi all,
>>
>> Is there a way to get a specific document to appear
on top of
>> search results even if a sorting parameter would
push it further  
>> down?
>>
>> Thanks in advance,
>> Mark
>>
>> mark angelillo
>> snooth inc.
>> o: 646.723.4328
>> c: 484.437.9915
>> marksnooth.com
>> snooth -- 1.8 million ratings and counting...
>>
>>
>

mark angelillo
snooth inc.
o: 646.723.4328
c: 484.437.9915
marksnooth.com
snooth -- 1.8 million ratings and counting...



Re: Forced Top Document
user name
2007-10-24 14:51:45
The typical use case, though, is for the featured document
to be on top only
for certain queries.  Like in an intranet where someone
queries 401K or
retirement or similar, you want to feature a document about
benefits that
would otherwise rank really low for that query.  I have not
be able to make
sorting strategies work very well.

Our approach has been to create a separate index of featured
items that are
tagged by the desired query. And then the results are placed
in a different
hit list as featured results (sort of like sponsored
results).




On 10/24/07, mark angelillo <listssnooth.com> wrote:
>
> Charlie,
>
> That's interesting. I did try something like this. Did
you try your
> query with a sorting parameter?
>
> What I've read suggests that all the results are
returned based on
> the query specified, but then resorted as specified.
Boosting (which
> modifies the document's score) should not change the
order unless the
> results are sorted by score.
>
> Mark
>
> On Oct 24, 2007, at 1:05 PM, Charlie Jackson wrote:
>
> > Do you know which document you want at the top? If
so, I believe you
> > could just add an "OR" clause to your
query to boost that document
> > very
> > high, such as
> >
> > ?q=foo OR id:bar^1000
> >
> > Tried this on my installation and it did, indeed
push the document
> > specified to the top.
> >
> >
> >
> > -----Original Message-----
> > From: Matthew Runo [mailto:mrunozappos.com]
> > Sent: Wednesday, October 24, 2007 10:17 AM
> > To: solr-userlucene.apache.org
> > Subject: Re: Forced Top Document
> >
> > I'd love to know this, as I just got a development
request for this
> > very feature. I'd rather not spend time on it if
it already exists.
> >
> >
+--------------------------------------------------------+
> >   | Matthew Runo
> >   | Zappos Development
> >   | mrunozappos.com
> >   | 702-943-7833
> >
+--------------------------------------------------------+
> >
> >
> > On Oct 23, 2007, at 10:12 PM, mark angelillo
wrote:
> >
> >> Hi all,
> >>
> >> Is there a way to get a specific document to
appear on top of
> >> search results even if a sorting parameter
would push it further
> >> down?
> >>
> >> Thanks in advance,
> >> Mark
> >>
> >> mark angelillo
> >> snooth inc.
> >> o: 646.723.4328
> >> c: 484.437.9915
> >> marksnooth.com
> >> snooth -- 1.8 million ratings and counting...
> >>
> >>
> >
>
> mark angelillo
> snooth inc.
> o: 646.723.4328
> c: 484.437.9915
> marksnooth.com
> snooth -- 1.8 million ratings and counting...
>
>
>
Re: Forced Top Document
user name
2007-10-24 15:15:52
> The typical use case, though, is for the featured
document to be on top only
> for certain queries.  Like in an intranet where someone
queries 401K or
> retirement or similar, you want to feature a document
about benefits that
> would otherwise rank really low for that query.  I have
not be able to make
> sorting strategies work very well.

Depending on how many of these certain queries you have, it
seems like
you could still use some variation of the strategy based on
a bogus
tag sort. If you place a dynamic field for each query term
(e.g.
foo_s, bar_s, etc) relevant to a document and then detect
when one of
the special query terms is detected, you can still sort on
the
appropriate dynamic field before applying the rest of the
sort.

kyle

Re: Forced Top Document
user name
2007-10-24 15:36:37
That's the ticket exactly, Kyle.

What I have is the ID of my document, so I indexed a dynamic
field  
with name id_*. Then I just set that field for each document
with the  
proper ID.

So for example, to pop one document to the top of the index,
i just run:

"&q=field: value; id_700390+desc, date+desc"

Works like a charm, even with multiple documents.

"&q=field: value; id_700390+desc, id_604030+desc,
date+desc"

Mark

On Oct 24, 2007, at 4:15 PM, Kyle Banerjee wrote:

>> The typical use case, though, is for the featured
document to be  
>> on top only
>> for certain queries.  Like in an intranet where
someone queries  
>> 401K or
>> retirement or similar, you want to feature a
document about  
>> benefits that
>> would otherwise rank really low for that query.  I
have not be  
>> able to make
>> sorting strategies work very well.
>
> Depending on how many of these certain queries you
have, it seems like
> you could still use some variation of the strategy
based on a bogus
> tag sort. If you place a dynamic field for each query
term (e.g.
> foo_s, bar_s, etc) relevant to a document and then
detect when one of
> the special query terms is detected, you can still sort
on the
> appropriate dynamic field before applying the rest of
the sort.
>
> kyle

mark angelillo
snooth inc.
o: 646.723.4328
c: 484.437.9915
marksnooth.com
snooth -- 1.8 million ratings and counting...



[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )