[ 
https://issues.apache.org/jira/browse/SOLR-11722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16277892#comment-16277892
 ] 

Gus Heck commented on SOLR-11722:
---------------------------------

I think we can handle the creation of the properly formatted collection name 
and maybe we can pull the creation metadata from an example collection? The 
example collection can be retained for future use, modified or deleted as the 
user sees fit as we will still record any parameters we care about as alias 
metadata. This should be nice and convenient for folks initially investigating 
this feature, and it also avoids duplicating configuration parameters already 
defined elsewhere here. Someone checking it out for the first time can just 
throw the name of an existing collection with a time valued field in it and 
start playing. 

Also, in thinking about usability I suspect we may want to allow a full time 
stamp including timezone specifier in the names for collections so that users 
don't have to have dig into zookeeper or the collections api to determine what 
timezone is in play. (they could even perhaps find out using {{&fl=\[shard]}}). 
Such a thing would however require adjustment of the regular expressions in 
TimeRoutedAliasUpdateProcessor.

How about a set of options like this? (expressed here as an addition to the 
v2api _introspect for create-alias)
{code}
        "collection-routing": {
          "type": "string",
          "description": "The type of routing to perform. Currently only 'time' 
is supported. This property is mutually exclusive with 'collections', and 
required with any route-* property. Collections created will be named for the 
alias and the first value allowed for the partition represented by each 
collection separated by an underscore. Time based routing will express the 
first value as a time stamp including the applicable timezone specifier (only 
time based routing is supported at this time)"
        },
        "route-field": {
          "type": "string",
          "description": "The field in incoming documents that is consulted to 
decide which collection the document should be routed to."
        },
        "route-start": {
          "type": "string",
          "description": "The earliest/lowest value for routeField that may be 
indexed into this alias. Documents with values less than this will return an 
error. For time based routing this may be a date math expression."
        },
        "route-timezone": {
          "type": "string",
          "description": "Optional timezone for time based routing. If omitted, 
UTC timezone will be used"
        },
        "route-increment": {
          "type": "string",
          "description": "A specification of the width of the interval for each 
partition collection. For time based routing this should be a date math 
expression fragment starting with the + character. When appended to a standard 
iso date the result should be a valid date math expression."
        },
        "route-example-collection": {
          "type": "string",
          "description": "A collection to use as an initial example for the 
creation of the initial partition of a collection routing alias. Subsequent 
partitions will ignore this value and will take configuration values (config, 
numShards, etc) from the first partition."
        },
{code}

> API to create a Time Routed Alias and first collection
> ------------------------------------------------------
>
>                 Key: SOLR-11722
>                 URL: https://issues.apache.org/jira/browse/SOLR-11722
>             Project: Solr
>          Issue Type: Sub-task
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: SolrCloud
>            Reporter: David Smiley
>
> This issue is about creating a single API command to create a "Time Routed 
> Alias" along with its first collection.  Need to decide what endpoint URL it 
> is and parameters.
> Perhaps in v2 it'd be {{/api/collections?command=create-routed-alias}} or 
> alternatively piggy-back off of command=create-alias but we add more options, 
> perhaps with a prefix like "router"?
> Inputs:
> * alias name
> * misc collection creation metadata (e.g. config, numShards, ...) perhaps in 
> this context with a prefix like "collection."
> * metadata for TimeRoutedAliasUpdateProcessor, currently: router.field
> * date specifier for first collection; can include "date math".
> We'll certainly add more options as future features unfold.
> I believe the collection needs to be created first (referring to the alias 
> name via a core property), and then the alias pointing to it which demands 
> collections exist first.  When figuring the collection name, you'll need to 
> reference the format in TimeRoutedAliasUpdateProcessor.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to