Good evening,
Here are more thoughts about URL rewriting...
I'm wondering now about what should be done when a parameter is not set.
For example, it would be nice to have both:
/cassandre/_design/cassandre/_rewrite/item/?corpus=MISS rewritten to
/cassandre/_design/cassandre/_list/mapping/kwic?startkey=["MISS"]&endkey=["MISS",{}]
and
/cassandre/_design/cassandre/_rewrite/item/ rewritten to
/cassandre/_design/cassandre/_list/mapping/kwic
Maybe this could be done with a single rewrite rule (with unset variables as a
special case):
[
{
"from": "item/",
"to": "_list/mapping/kwic",
"query": {
"startkey": [":corpus"],
"endkey": [":corpus",{}]
}
}
]
... or maybe with a sequence of rules, with the next rule being tested when the
last one failed:
[
{
"from": "item/",
"to": "_list/mapping/kwic",
"query": {
"startkey": [":corpus"],
"endkey": [":corpus",{}]
}
}, {
"from": "item/",
"to": "_list/mapping/kwic"
}
]
Does one of these solutions makes sense?
Regards,
Aurélien