Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Solved
Go to solution
set morphline variable from if command
Explorer
Created 02-02-2014 11:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possble to set the value of SOLR_LOCATOR from a morphline if command? I want to assign which collection the output data should flow to based on a contains match of a substring within the _attachment_body.
1 ACCEPTED SOLUTION
Super Collaborator
Created 02-02-2014 11:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All variables have to statically resolve at compile time. Still, you can statically enumerate multiple solrLocators and do stuff like this:
if
{
conditions : [
{ equals { tenant : [foo] } }
]
then : [
{
loadSolr { solrLocator : { collection : collection_foo, zkHost : "127.0.0.1:2181/solr" } }
}
]
else : [
{
loadSolr { solrLocator : { collection : collection_bar, zkHost : "127.0.0.1:2181/solr" } }
}
]
}
Wolfgang.
if
{
conditions : [
{ equals { tenant : [foo] } }
]
then : [
{
loadSolr { solrLocator : { collection : collection_foo, zkHost : "127.0.0.1:2181/solr" } }
}
]
else : [
{
loadSolr { solrLocator : { collection : collection_bar, zkHost : "127.0.0.1:2181/solr" } }
}
]
}
Wolfgang.
1 REPLY 1
Super Collaborator
Created 02-02-2014 11:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All variables have to statically resolve at compile time. Still, you can statically enumerate multiple solrLocators and do stuff like this:
if
{
conditions : [
{ equals { tenant : [foo] } }
]
then : [
{
loadSolr { solrLocator : { collection : collection_foo, zkHost : "127.0.0.1:2181/solr" } }
}
]
else : [
{
loadSolr { solrLocator : { collection : collection_bar, zkHost : "127.0.0.1:2181/solr" } }
}
]
}
Wolfgang.
if
{
conditions : [
{ equals { tenant : [foo] } }
]
then : [
{
loadSolr { solrLocator : { collection : collection_foo, zkHost : "127.0.0.1:2181/solr" } }
}
]
else : [
{
loadSolr { solrLocator : { collection : collection_bar, zkHost : "127.0.0.1:2181/solr" } }
}
]
}
Wolfgang.