My listing looks like : 
https://drive.google.com/file/d/1Pw94topEJfarEA_P5JeiDOsHlvyACPK0/view
ID, Form Title and Created Date are coming from form collection while My Tasks 
is coming from actionscomments collection.
My listing fields are mapped with schema fields below:
collection name Listing Fields  Scehma Fields
forms   ID      id
Form Title      title
Created Date    form_creation_date
actionscomments ID      id
My Tasks        title

My form collection has forms related data and actionscomments collection has 
action related data. One form has many actions. So, we put a separate 
collection.

My storage like below:
actionscomments collections data
 {
        "id":"ACTC10589345_656644",
        "title":"Respond"
"form_id":"10252140",
"project_id":"102578"
 },
      {
        "id":"ACTC10589345_709647",
        "title":"For Information"
"form_id":"10252141",
"project_id":"102578"
 }

form collection data
  {
        "id":"RFI019(2)",
        "title":"QA Test 01",
        "form_creation_date":"25-Jun-2018"
"form_id":"10252140",
"project_id":"102578"
  },
  {
        "id":"RFI011(3)",
        "title":"Test_RFI_Bolgs",
        "form_creation_date":"29-Nov-2017"
"form_id":"10252141",
"project_id":"102578"
  },
  {
        "id":"RFI015",
        "title":"Check",
        "form_creation_date":"20-Nov-2017"
"form_id":"10252142",
"project_id":"102579"
  }


 As of now one form has only one action but possible one form has many actions.
  For getting listing of project_id:102578, First we sort in ascending in 
actionscomments with field title so we get form_id in order 10252141 and 
10252140.
  Base on that ordered form_id we want same order data in form collection for 
project_id:102578

I am expecting listing like first form "Test_RFI_Bolgs" and second "QA Test 01".

 How can we achieve this?

Regards,
Vishal Patel
________________________________
From: Erick Erickson <erickerick...@gmail.com>
Sent: Tuesday, June 23, 2020 5:07 PM
To: solr-user@lucene.apache.org <solr-user@lucene.apache.org>
Subject: Re: Sorting in other collection in Solr 8.5.1

You have two separate collections with dissimilar data, so what
does “sorting them in the same order” mean? Your example
sorts on title, so why can’t you sort them both on title? That won’t
work of course for any field that isn’t identical in both
collections.

These are actually pretty small collections. It sounds like you’re
doing what in SQL terms would be a sub-select. Have you considered
putting all the records (with different types) in the same collection
and using something like join queries or RerankQParser?

Don’t know how that fits into your model….

Best,
Erick

> On Jun 23, 2020, at 2:06 AM, vishal patel <vishalpatel200...@outlook.com> 
> wrote:
>
> Hi
>
> I am upgrading Solr 8.5.1. I have created 2 shards and each has one replica.
> I have created 2 collection one is form and second is actionscomment.forms 
> related data are stored in form collection and actions of that forms are 
> stored in actionscomment collection.
> There are 10 lakh documents in form and 50 lakh documents in actionscomment 
> collection.
>
> form schema.xml
> <field name="id" type="string" indexed="true" stored="true" required="true" 
> multiValued="false" docValues="true"/>
> <field name="project_id" type="tint" indexed="true" stored="true" 
> docValues="true"/>
> <field name="form_id" type="tint" indexed="true" stored="true" 
> docValues="true"/>
> <field name="title" type="text_string" indexed="true" stored="true" 
> omitNorms="true"/>
> <field name="form_creation_date" type="date" indexed="true" stored="true" 
> docValues="true"/>
>
> actionscomment schema.xml
> <field name="id" type="string" indexed="true" stored="true" required="true" 
> multiValued="false" docValues="true"/>
> <field name="project_id" type="tint" indexed="true" stored="true" 
> docValues="true"/>
> <field name="form_id" type="tint" indexed="true" stored="true" 
> docValues="true"/>
> <field name="action_id" type="tint" indexed="true" stored="true"/>
> <field name="title" type="text_string" indexed="true" stored="true" 
> omitNorms="true"/>
> <field name="action_date" type="date" indexed="true" stored="true" 
> docValues="true"/>
> <field name="action_complete_date" type="date" indexed="true" stored="true" 
> docValues="true"/>
>
>
>
> We are showing form listing using form and actionscomment collection. We are 
> showing only 250 records in form listing page. Our form listing columns are 
> id,title,form created date and action names. id,title,form created date and 
> action names come from form collection and action names come from 
> actionscomment collection. We want to give the sorting functionality for all 
> columns.It is easy to sort id, title and form created date because it is in 
> same collection.
>
> For action name sorting, I execute 2 query. First I execute query in 
> actionscomment collection with sort field title and get the form_id list and 
> using those form_ids I execute in form collection. But I do not get the 
> proper sorting. Sometimes I got so many form ids and my second query length 
> becomes larger.
> How can I get data from form collection same as order of form id list came 
> from actionscomment?
>
> Regards,
> Vishal Patel
> <http://aka.ms/weboutlook>

Reply via email to