Issue Searching Data from multiple Databases
I am trying to achieve search by connecting to multiple Databases (in my case trying with 2 different DBs) to index data from multiple DB tables. I have tried doing the below as an approach to achieve my goal but in vain, I am able to get only data from the DB 1 when I perform a full-import. Steps performed : 1. Added multiple data source in the data-config.xml file as shown below : 2. Added multiple entities against each data source added as shown below : 3. Added appropriate fields in the managed-schema.xml file as well 4. Reloaded the collection for the changes to take affect. 5. Performed a full import. even observed that the data has not got imported from DB2. 6. Did a search only to find the data from DB1 is getting fetched where as data from DB2 is not at all getting fetched. Suggestions/Guidance shall be highly appreciated. Please let me know in case you need any further information. Note : I tried connecting 2 different DBs on 2 different servers and also 2 different DBs on same server as well. Thank you in advance!! -- Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Sorting based on Date and Name combination in Solr 6.2
Hi, We have a scenario where we need to sort on Date and Name combination. We have a Date field of type DateTime and a Name field. When we try sorting it, then the records are getting sorted based on Timestamp, but we need to sort only on date part keeping timestamp part aside. Here is an example : We need to sort the below 4 values : 2019-07-02 11:12:13Z SANTOSH 2019-07-02 12:12:13Z BALA 2019-07-02 13:13:13Z ANAND 2019-07-02 14:15:13Z CHANDAR Expected Result is as follows :: 2019-07-02 12:12:13Z ANAND 2019-07-02 13:13:13Z BALA 2019-07-02 14:15:13Z CHANDAR 2019-07-02 11:12:13Z SANTOSH Here we would like the sort to consider only the date part of the field and then use the name field. In this way, documents for different dates will appear sorted first by date (without time) and then by name. Below are the queries I have on this : 1. How can we achieve the above said scenario (explained in example above) in Solr 6.2 Any solutions are highly appreciated. Thank you in advance. -- Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: Sorting based on Date and Name combination in Solr 6.2
Thank you Shawn for your prompt response. However we have that option open of having a separate date only field or a separate field with date along with default Timestamp like you mentioned (00:00:00.000). But this change shall need a full-import or full crawl, as we lot many data, we looking out at any other probable solution. Thank you once again and I appreciated your reply, I will definitely consider your solution. -- Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: Sorting based on Date and Name combination in Solr 6.2
Thank you Shawn for your prompt response. However we have that option open of having a separate date only field or a separate field with date along with default Timestamp like you mentioned (00:00:00.000). But this change shall need a full-import or full crawl, as we lot many data, we looking out at any other probable solution. Thank you once again and I appreciated your reply, I will definitely consider your solution. Shawn Heisey-2 wrote > On 7/10/2019 7:22 AM, Santosh Kumar S wrote: >> When we try sorting it, then the records are getting sorted based on >> Timestamp, but we need to sort only on date part keeping timestamp part >> aside. > > That is how sorting on a field that has a timestamp is going to work. > It will always use the whole field. > >> Here we would like the sort to consider only the date part of the field >> and >> then use the name field. >> In this way, documents for different dates will appear sorted first by >> date >> (without time) and then by name. > > If you want to only sort by date without the time, you will need a field > into which you index date only, either without the timestamp or with a > common timestamp (probably 00:00:00.000). If going with date only, it's > probably better to use a string field than a date field. It's up to you > whether you change the existing date field and update your indexing > software, or add a new one and have your indexing program copy the date > from the date field to a text field. > > I do not know whether the ParseDateFieldUpdateProcessorFactory could be > used to handle this on the Solr side with a copyField: > > https://lucene.apache.org/solr/7_2_0//solr-core/org/apache/solr/update/processor/ParseDateFieldUpdateProcessorFactory.html > > Once you have the correct date only field, you would have to simply use > a parameter like this: > > sort=date_only asc, name asc > > Thanks, > Shawn -- Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html