Simple cloudant word search by timestamp - need help

#1

My cloudant database was created with the following: msg.payload via tweetnode to cloudant

{ 
   "timestamp" : msg.tweet.timestamp_ms, 
   "tweet" : msg.tweet.text, 
   "sentiment" : msg.sentiment.score
}

I would like to search the tweet field by word and timestamp by a range of dates. Then save the results by tagging the tweets found back to cloudant via node-red.

This seems like a routine thing people do. I have not found any flows that do this. Help is appreciated - especially a link to a working search by text using cloudant flow!

#2

The index I am using is this

function(doc) {
index("default", doc._id);
if (doc.timestamp) {
index("timestamp", doc.timestamp, {"store": true});
}
if (doc.tweet) {
index("tweet", doc.tweet, {"store": true});
}
if (doc.sentiment) {
index("sentiment", doc.sentiment, {"store": true});
}
}

#3

Here is the very simple flow :
I need the correct .json to access searching by text

[{"id":"d97b9063.f8ed5","type":"tab","label":"SeachbyTimestamptweet","disabled":false,"info":""},{"id":"ee136fe.41b259","type":"function","z":"d97b9063.f8ed5","name":"Selector","func":" msg.payload = {\n   query: \"tweet : sometext<string>\",\n }\n    \n\nreturn msg;","outputs":1,"noerr":0,"x":496.5,"y":326,"wires":[["6886370a.572098","c7a70ad1.dfd8c8"]]},{"id":"6886370a.572098","type":"debug","z":"d97b9063.f8ed5","name":"","active":true,"console":"true","complete":"payload","x":759.5,"y":300,"wires":[]},{"id":"ab27b442.879dc8","type":"debug","z":"d97b9063.f8ed5","name":"dashDB Output","active":true,"console":"false","complete":"payload","x":918.5,"y":370,"wires":[]},{"id":"b16088c.b8a1a78","type":"inject","z":"d97b9063.f8ed5","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":261,"y":249,"wires":[["ee136fe.41b259"]]},{"id":"c7a70ad1.dfd8c8","type":"cloudant in","z":"d97b9063.f8ed5","name":"timestamp/tweet","cloudant":"98949ae5.b3cdd8","database":"tweetdata","service":"Cloudant-Twitter #Esports Collector","search":"_idx_","design":"newViewsAll","index":"IndexALL","x":698,"y":392,"wires":[["ab27b442.879dc8"]]},{"id":"94f1242a.c9c8f8","type":"comment","z":"d97b9063.f8ed5","name":"Search pattern","info":"","x":243.00003051757812,"y":612.0000076293945,"wires":[]},{"id":"98949ae5.b3cdd8","type":"cloudant","z":"","host":"myaccountname.cloudant.com","name":"My Cloudant account"}]