Hello Alessandro, 

An example of a document:

{
        "SolrShard": "05/10/2015!02bebd2e-f12b-4787-bef2-57b0c5ed42ee",
        "ContentVersion": 11,
        "Session_Browser": "IE 11",
        "Session_UserAgent": [
          "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
        ],
        "Session_OS": "Windows 7",
        "_version_": 1516909630614143000
      },

With the unique key being SolrShard:


"SolrShard": "05/10/2015!02bebd2e-f12b-4787-bef2-57b0c5ed42ee"

I verified by loading two dates, the document routing worked as follows:

Shard 1:  05/10/2015 data 
Shard 2:  02/10/2015 data 

using the query:

/solr/sessionfilterset/select?q=*%3A*&wt=json&indent=true&_route_=05/10/2015!

returned the expected results. 

However, I've now got more data loaded:

Shard 1: has 05/10/2015 data on it
Shard 2: has 02/10/2015 and 01/10/2015 data on it.

When I query  

/solr/sessionfilterset/select?q=*%3A*&wt=json&indent=true&_route_=02/10/2015!

I get results from both 02/10/2015 and 01/10/2015. 

For these documents the  unique key is correct, with either 02/10/2015! or 
01/10/2015! before the GUID

Any ideas?

Thanks for your help.






________________________________________
From: Alessandro Benedetti <abenede...@apache.org>
Sent: 04 November 2015 12:29
To: solr-user@lucene.apache.org
Subject: Re: API collection, Migrate deleting all data

Hi Philippa,
can you show us an example of document ?
In particular i would like to see the ID you are using.
I would expect a compositeId in the form:
shardkey!id

have you verified first of all that the compositeId routing and shardKey is
currently working ?
This is the first step, as I think the parameters you are using are ok, but
just wondering if something is wrong with the compositeId you are using.

Cheers

On 4 November 2015 at 11:40, philippa griggs <philippa.gri...@hotmail.co.uk>
wrote:

> Hello,
>
>
> Solr 5.2.1, Zookeeper 3.4.6
>
>
> I'm trying the use the solr Collection API to migrate documents in a test
> environment. I have two collections set up
>
>
> HotSessions - two shards, no replicas
>
> ColdSessions - 1 shard, no replicas.
>
>
> I've upload some sample data and using document routing with a split.key
> of the date e.g. 05/10/2015!.  The command I use to migrate is:
>
>
>
> /admin/collections?action=MIGRATE&collection=HotSessions&split.key=05/10/2015!&target.collection=ColdSessions&forward.timeout=60
>
>
> This returns:
>
>
> <response>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">14608</int>
> </lst>
> <lst name="success">
> <lst>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">1</int>
> </lst>
> <str name="core">ColdSessions</str>
> <str name="status">BUFFERING</str>
> </lst>
> <lst>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">1818</int>
> </lst>
> <str name="core">split_shard2_temp_shard1_shard1_replica1</str>
> </lst>
> <lst>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">1077</int>
> </lst>
> </lst>
> <lst>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">43</int>
> </lst>
> </lst>
> <lst>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">1371</int>
> </lst>
> <str name="core">split_shard2_temp_shard1_shard1_replica2</str>
> </lst>
> <lst>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">9014</int>
> </lst>
> </lst>
> <lst>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">70</int>
> </lst>
> </lst>
> <lst>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">0</int>
> </lst>
> <str name="core">ColdSessions</str>
> <str name="status">EMPTY_BUFFER</str>
> </lst>
> <lst name="10.234.223.111:8984_solr">
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">30</int>
> </lst>
> </lst>
> <lst name="10.234.223.111:8983_solr">
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">31</int>
> </lst>
> </lst>
> </lst>
> </response>
>
>
> In the error logs there is the migrate message
>
>
> OverseerCollectionProcessor.processMessage : migrate , {
>   "collection":"HotSessions",
>   "split.key":"02/10/2015!",
>   "target.collection":"ColdSessions",
>   "forward.timeout":"60",
>   "operation":"migrate"}
>
>
> Followed by:
>
> -WARN 'no frame of reference to tell if we've missed updates'
>
> -ERROR 'Error removing directory:java.io.IOException: Failed to list
> contents of /solr/lost+found
>
> -WARN 'Our node is no longer in line to be leader'
>
> -ERROR 'auto commit error...: java.nio.file.NoSuchFileException:
> /solr/ColdSessions/index/pending_segments_3'
>
> -ERROR 'IO error while trying to get the size of the Directory:
> java.nio.file.NoSuchFileException: /Solr/ColdSessions/Index'
>
> -ERROR 'IO error while trying to get the size of the Directory:
> java.nio.file.NoSuchFileException: /Solr/HotSessions/Index'
>
> -ERROR 'IO error while trying to get the size of the Directory:
> java.nio.file.NoSuchFileException: /Solr/HotSessions/ind'
>
>
>
>
> When I  query solr- all my session have gone, from both collections.
> Looking at the file structure, in my data folder all files have gone apart
> from a lost+found folder.
>
>
> What am I doing wrong? Is there anything in my setup which would cause
> this or is my API call wrong?
>
>
> Any help would be much appreciated.
>
>
> Philippa
>
>
>
>
>
>


--
--------------------------

Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England

Reply via email to