lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Binoy Dalal <binoydala...@gmail.com>
Subject Re: new data structure for some fields
Date Mon, 21 Dec 2015 11:51:46 GMT
OK. You will only be able to sort based on the integers if the integer
field is single valued, I.e. only one integer is associated with one
category I'd.

To do this you've to use the sort parameter.
You can either specify it in your solrconfig.XML like so:
<str name="sort">integer asc</str>
Field name followed by the order - asc/desc

Or you can specify the it along with our query by appending it to your
query like so:
/select?q=query&sort=integet%20asc

If you want to apply these sorting rules for all docs, then specify the
sorting in your solrconfig. If you only want It for a certain subset then
apply the parameter from code at the app level

On Mon, 21 Dec 2015, 16:49 Abhishek Mishra <solrmishra@gmail.com> wrote:

> hi binoy
> thanks for reply. I mean by sort is to sort the data-sets on the basis of
> integers values given for that category.
> For any document let say for an id P1,
> category associated is c1,c2,c3,c4 (using multivalued field)
> For new implementation
> similarly a number is associated with each category. let say
> c1---b1,c2---b2,c3---b3,c4---b4.
> now when we querying into solr for the ids which have c1 in their
> categories. (q=category_id:c1) now i want the result of this query sorted
> on the basis of number(b) associated with it throughout the result..
>
> number of association is usually less than 20 (means an id can't be mapped
> more than 20 category_ids)
>
>
> On Mon, Dec 21, 2015 at 3:59 PM, Binoy Dalal <binoydalal93@gmail.com>
> wrote:
>
> > When you say sort, do you mean search on the basis of category and
> > integers? Or score the docs based on their category and integer values?
> >
> > Also, for any given document, how many categories or integers are
> > associated with it?
> >
> > On Mon, 21 Dec 2015, 14:43 Abhishek Mishra <solrmishra@gmail.com> wrote:
> >
> > > Hello all
> > >
> > > i am facing some kind of requirement that where for an id p1 is
> > associated
> > > with some category_ids c1,c2,c3,c4 with some integers b1,b2,b3,b4. We
> > need
> > > to sort the query of solr on the basis of b1/b2/b3/b4 depending on
> given
> > > category_id . Right now we mapped the category_ids into multi-valued
> > > attribute. [c1,c2,c3,c4] something like this. we are querying into it.
> > But
> > > from now we also need to find which integer b1,b2,b3.. associated with
> > > given category and also sort the whole query on it.
> > >
> > >
> > > sorry for any typos..
> > >
> > > Regards
> > > Abhishek
> > >
> > --
> > Regards,
> > Binoy Dalal
> >
>
-- 
Regards,
Binoy Dalal

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