What you probably want to achieve is displaying only docs in a certain category (maybe filtered) ordered by descending score in the context of exactly this category, right?

Well, you could come over this by creating a category specific score field for every category following the schema "cat-X-score" where X is the identifier of each of your categories. Then when receiving a request for your category you programmatically have to build the sort-by condition for field "cat-Y-score", where Y is the category id of the category you received the request for.

*tobi*

Umar Shah wrote:
Hi Otis,

thanks for the reply,

consider a multivalued field name cat
<doc>
--other fields

<field name=cat> val 1 <field name="catrank> score1 </field> </field>
<field name=cat> val 2 <field name="catrank> score2 </field> </field>
<field name=cat> val 3 <field name="catrank> score3 </field> </field>
......

--other fields

<doc>

the query i have to use is
q= cat:query-text; sort catrank desc

get all the documents
WITH field  cat HAVING  query-text
AND order by catrank desc

On 3/8/08, Otis Gospodnetic <[EMAIL PROTECTED]> wrote:
Umar,

I'm not sure what you mean by a "subfield", can you explain please?

As for your second question, just add category:X to your query and you'll
get matches ordered/ranked by score by default.

Otis


--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch


----- Original Message ----
From: Umar Shah <[EMAIL PROTECTED]>
To: solr-user@lucene.apache.org
Sent: Friday, March 7, 2008 1:17:35 AM
Subject: ranking on Multivalued fields

Hi,

I have a problem where i want to rank multivalued fields

suppose a multivalued field "category" having associated subfield "score".
First Is it possible to have a subfield in the mutlivalued field?
Second I want to get the documents ranked with the highest score say for
the
category:X

thanks
Umar Shah






Reply via email to