Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
/search/feed/

...

Info

Retrieves a specific channel or all channels available to the user if channel_id is not provided. (TODO: UPDATE)

Possible Methods

POST PUT DELETE

Arguments 
(TODO: UPDATE)

channel_id(optional)
Channel id to try and return, if not provided returns all channels for current user

Json Object
(TODO: UPDATE)

...

{channel_id}
/search/feed?channel_id=abc1234
Info

Returns a list of documents that should just be nsight-events for a given channel_id or the posted data (cannot be both)

 

Info

This function has 2 modes:

  1. Initial search mode which corresponds to the POST version, takes a list of keywords and locations and returns a feed of related events to start building a channel from, can pass an optional ?channel_id=id to have the searches effect the channels score
  2. Channel search mode which corresponds to the GET version, takes a channel_id and returns a feed of significant events based on the scoring of a channel (liked/disliked events).
Possible Methods

GET, POST

Arguments

channel_id: (optional) id of the channel you want to return a feed for, used in the GET request or when passed as a query param in the POST request, will update score for that channel based on keyword searches

Json Object
Code Block
SearchFeedApiPojo
{
    List<String> search_terms =  "channel_id" : "531733e8b8e08e9d2197b0b0",
        "events" : [],
   new ArrayList<String>();
    List<ChannelLocationApiPojo> locations = new ArrayList<ChannelLocationApiPojo>();
}

ChannelLocationApiPojo
{
	String location_id;
    Double latitude;
    "locations" : [],Double longitude;
    Double radius;
   "name" : "abc123"Date timestamp;
}

 

Example 

...

Example
Code Block
curl -b cookies.txt -X GET "http://localhost:8185/channelsearch/feed/531f3e50b8e0a93944925594" > response.txt

curl -b cookies.txt -X GETPOST -d '{ "search_terms":["obama","white house"], "locations":[{"latitude":38.881813, "longitude":-76.992188, "radius":500.0}] }' "http://localhost:8185/channelsearch/531733e8b8e08e9d2197b0b0feed" > response.txt
curl txt 
Example Response
Info
curl -b cookies.txt -X POST -d '{"name":"abc123"}' "http://localhost:8185/channel" > response.txt curl -b cookies.txt -X PUT-d '{"name":"renamed my channel"}' "http://localhost:8185/channel/531733e8b8e08e9d2197b0b0" > response.txt curl -b cookies.txt -X PUT-d '{"channel_id":"531733e8b8e08e9d2197b0b0", "name":"renamed my channel"}' "http://localhost:8185/channel" > response.txt curl -b cookies.txt -X DELETE -d '{"channel":"531733e8b8e08e9d2197b0b0"}' "http://localhost:8185/channel" > response.txt curl -b cookies.txt -X DELETE "http://localhost:8185/channel/531733e8b8e08e9d2197b0b0" > response.txt

 

Example Response
(TODO: UPDATE)
 -X GET "http://localhost:8185/search/feed/531f3e50b8e0a93944925594" > response.txt

 

Info
Code Block
Code Block
 {
    "response": {
        "action": "Query",
        "success": true,
        "message": "((tags:twitter)) or ((tags:sandy)) or ((tags:custom)) or ((index:\"captainbigbones/twitterhandle\")) or ((index:\"btw 2nd/keyword\" OR ((\"btw 2nd\")))) or ((index:\"brhoboken/twitterhandle\")) or ((index:\"@hobokenproblems/twitterer\")) or ((index:\"@hiddenhoboken/twitterer\"))",
        "time": 5457
    },
    "data": 
         [{
            "_id": "52e2e84ae4b013563c3ea317",
            "title": "score:0.0580 (4 tweets, 3.0 posters), [nyc ], eg: Lane Savage: NYC sleeps after all. #HurricaneSandy http://t.co/gPNWt2Ph",
            "url": "inf://custom/52e054d9e4b04bbf8b8621d7/yuri_idf_clusterer_04_smaller_clusters/52e079a7e4b08dc56ad49806.json",
            "created": "Jan 24, 2014 10:21:21 PM UTC",
            "modified": "Jan 23, 2014 02:01:04 AM UTC",
            "publishedDate": "Oct 30, 2012 02:22:00 AM UTC",
            "source": ["clusters_from_clusterer_04"],
            "sourceKey": ["inf...custom.yuri_idf_clusterer_04.geo_only."],
            "mediaType": ["Record"],
            "description": "Lane Savage: NYC sleeps after all. #HurricaneSandy http://t.co/gPNWt2Ph\nJonathan C. Zaback: BREAKING: The water level at the Battery in #NYC has reached 11.25 feet, surpassing the all-time record of 11.2 feet set in 1821. #Sandy\nSophie Masure: NYC #blackout #sandy  @ Chelsea http://t.co/zrCyxMKN\nSophie Masure: Out street #blackout #sandy  @ Chelsea http://t.co/ZGWI4vGS\n",
            "entities": [{
                "disambiguated_name": "http://t.co/gPNWt2Ph",
                "index": "http://t.co/gpnwt2ph/url",
                "actual_name": "http://t.co/gPNWt2Ph",
                "type": "url",
                "relevance": 0.5,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 1,
                "dimension": "What",
                "significance": 0.03152317847757192,
                "datasetSignificance": 0.03152317847757192,
                "queryCoverage": 0.29940119760479045,
                "averageFreq": 0.0029940119760479044
            },
            {
                "disambiguated_name": "lanesavage",
                "index": "lanesavage/twitterhandle",
                "actual_name": "Lane Savage",
                "type": "TwitterHandle",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 2,
                "dimension": "Who",
                "linkdata": ["http://www.twitter.com/lanesavage"],
                "significance": 0.06295253783287143,
                "datasetSignificance": 0.04431605199110648,
                "queryCoverage": 0.5988023952095809,
                "averageFreq": 0.005988023952095809
            },
            {
                "disambiguated_name": "NYC",
                "index": "nyc/location",
                "actual_name": "NYC",
                "type": "Location",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 115,
                "geotag": {
                    "lat": 42.1497,
                    "lon": -74.9384
                },
                "dimension": "Where",
                "ontology_type": "point",
                "significance": 9.45619726379861,
                "datasetSignificance": 6.262925882011357,
                "queryCoverage": 34.4311377245509,
                "averageFreq": 0.344311377245509
            },
            {
                "disambiguated_name": "HurricaneSandy",
                "index": "hurricanesandy/hashtag",
                "actual_name": "HurricaneSandy",
                "type": "HashTag",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 99,
                "dimension": "What",
                "significance": 8.296359196919038,
                "datasetSignificance": 5.1065210676256365,
                "queryCoverage": 29.64071856287425,
                "averageFreq": 0.2964071856287425
            },
            {
                "disambiguated_name": "water level",
                "index": "water level/keyword",
                "actual_name": "water level",
                "type": "Keyword",
                "relevance": 1.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 3,
                "dimension": "What",
                "sentiment": -0.5450000166893005,
                "significance": 0.09428863485716633,
                "datasetSignificance": 0.06453025159044914,
                "queryCoverage": 0.8982035928143715,
                "averageFreq": 0.008982035928143714,
                "positiveSentiment": 0.0,
                "negativeSentiment": -1.1450000405311584,
                "sentimentCount": 3
            },
            {
                "disambiguated_name": "time record",
                "index": "time record/keyword",
                "actual_name": "time record",
                "type": "Keyword",
                "relevance": 1.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 2,
                "dimension": "What",
                "sentiment": -0.5450000166893005,
                "significance": 0.06295253783287143,
                "datasetSignificance": 0.03602253489385352,
                "queryCoverage": 0.5988023952095809,
                "averageFreq": 0.005988023952095809,
                "positiveSentiment": 0.0,
                "negativeSentiment": -0.5450000166893005,
                "sentimentCount": 1
            },
            {
                "disambiguated_name": "zabackj",
                "index": "zabackj/twitterhandle",
                "actual_name": "Jonathan C. Zaback",
                "type": "TwitterHandle",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 8,
                "dimension": "Who",
                "linkdata": ["http://www.twitter.com/zabackj"],
                "significance": 0.7563313030706813,
                "datasetSignificance": 0.5021356754068775,
                "queryCoverage": 2.3952095808383236,
                "averageFreq": 0.023952095808383235
            },
            {
                "disambiguated_name": "New York City",
                "index": "new york city/location",
                "actual_name": "New York City",
                "type": "Location",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 132,
                "geotag": {
                    "lat": 42.1497,
                    "lon": -74.9384
                },
                "dimension": "Where",
                "ontology_type": "point",
                "significance": 10.644135492309903,
                "datasetSignificance": 7.254806677085521,
                "queryCoverage": 39.52095808383233,
                "averageFreq": 0.39520958083832336
            },
            {
                "disambiguated_name": "NYC",
                "index": "nyc/hashtag",
                "actual_name": "NYC",
                "type": "HashTag",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 131,
                "dimension": "What",
                "significance": 10.575464267177358,
                "datasetSignificance": 6.912982786061084,
                "queryCoverage": 39.221556886227546,
                "averageFreq": 0.3922155688622755
            },
            {
                "disambiguated_name": "Sandy",
                "index": "sandy/hashtag",
                "actual_name": "Sandy",
                "type": "HashTag",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 287,
                "dimension": "What",
                "significance": 3.070064925717542,
                "datasetSignificance": 2.275837260692843,
                "queryCoverage": 85.92814371257485,
                "averageFreq": 0.8592814371257486
            },
            {
                "disambiguated_name": "http://t.co/zrCyxMKN",
                "index": "http://t.co/zrcyxmkn/url",
                "actual_name": "http://t.co/zrCyxMKN",
                "type": "url",
                "relevance": 0.5,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 1,
                "dimension": "What",
                "significance": 0.03152317847757192,
                "datasetSignificance": 0.03152317847757192,
                "queryCoverage": 0.29940119760479045,
                "averageFreq": 0.0029940119760479044
            },
            {
                "disambiguated_name": "sophiemasure",
                "index": "sophiemasure/twitterhandle",
                "actual_name": "Sophie Masure",
                "type": "TwitterHandle",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 1,
                "dimension": "Who",
                "linkdata": ["http://www.twitter.com/sophiemasure"],
                "significance": 0.03152317847757192,
                "datasetSignificance": 0.03152317847757192,
                "queryCoverage": 0.29940119760479045,
                "averageFreq": 0.0029940119760479044
            },
            {
                "disambiguated_name": "New York",
                "index": "new york/location",
                "actual_name": "New York",
                "type": "Location",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 79,
                "geotag": {
                    "lat": 40.7141667,
                    "lon": -74.0063889
                },
                "dimension": "Where",
                "ontology_type": "point",
                "significance": 6.784825402600096,
                "datasetSignificance": 4.474572406496156,
                "queryCoverage": 23.652694610778443,
                "averageFreq": 0.23652694610778444
            },
            {
                "disambiguated_name": "blackout",
                "index": "blackout/hashtag",
                "actual_name": "blackout",
                "type": "HashTag",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 18,
                "dimension": "What",
                "significance": 1.6772805768804468,
                "datasetSignificance": 1.0317455392795931,
                "queryCoverage": 5.389221556886228,
                "averageFreq": 0.05389221556886228
            },
            {
                "disambiguated_name": "http://instagram.com/p/RY-Q1BuQ5y/",
                "index": "http://instagram.com/p/ry-q1buq5y//url",
                "actual_name": "http://t.co/zrCyxMKN",
                "type": "URL",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 1,
                "dimension": "What",
                "significance": 0.03152317847757192,
                "datasetSignificance": 0.03152317847757192,
                "queryCoverage": 0.29940119760479045,
                "averageFreq": 0.0029940119760479044
            },
            {
                "disambiguated_name": "http://t.co/ZGWI4vGS",
                "index": "http://t.co/zgwi4vgs/url",
                "actual_name": "http://t.co/ZGWI4vGS",
                "type": "url",
                "relevance": 0.5,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 1,
                "dimension": "What",
                "significance": 0.03152317847757192,
                "datasetSignificance": 0.03152317847757192,
                "queryCoverage": 0.29940119760479045,
                "averageFreq": 0.0029940119760479044
            },
            {
                "disambiguated_name": "http://instagram.com/p/RY-j8ROQ6C/",
                "index": "http://instagram.com/p/ry-j8roq6c//url",
                "actual_name": "http://t.co/ZGWI4vGS",
                "type": "URL",
                "relevance": 0.0,
                "frequency": 1,
                "totalfrequency": 0,
                "doccount": 1,
                "dimension": "What",
                "significance": 0.03152317847757192,
                "datasetSignificance": 0.03152317847757192,
                "queryCoverage": 0.29940119760479045,
                "averageFreq": 0.0029940119760479044
            }],
            "tags": ["sandy",
            "twitter",
            "custom"],
            "communityId": "52dfe9dce4b00016fc2650cd",
            "sourceUrl": "inf://custom/52e054d9e4b04bbf8b8621d7/yuri_idf_clusterer_04_smaller_clusters/52e079a7e4b08dc56ad49806",
            "associations": [{
                "entity1": "lanesavage",
                "entity1_index": "lanesavage/twitterhandle",
                "verb": "tweets_about",
                "verb_category": "tweets_about",
                "entity2": "hurricanesandy",
                "entity2_index": "hurricanesandy/hashtag",
                "assoc_type": "Event"
            },
            {
                "entity1": "zabackj",
                "entity1_index": "zabackj/twitterhandle",
                "verb": "tweets_about",
                "verb_category": "tweets_about",
                "entity2": "nyc",
                "entity2_index": "nyc/hashtag",
                "assoc_type": "Event"
            },
            {
                "entity1": "zabackj",
                "entity1_index": "zabackj/twitterhandle",
                "verb": "tweets_about",
                "verb_category": "tweets_about",
                "entity2": "sandy",
                "entity2_index": "sandy/hashtag",
                "assoc_type": "Event"
            },
            {
                "entity1": "sophiemasure",
                "entity1_index": "sophiemasure/twitterhandle",
                "verb": "tweets_about",
                "verb_category": "tweets_about",
                "entity2": "blackout",
                "entity2_index": "blackout/hashtag",
                "assoc_type": "Event"
            },
            {
                "entity1": "sophiemasure",
                "entity1_index": "sophiemasure/twitterhandle",
                "verb": "tweets_about",
                "verb_category": "tweets_about",
                "entity2": "sandy",
                "entity2_index": "sandy/hashtag",
                "assoc_type": "Event"
            },
            {
                "entity1": "sophiemasure",
                "entity1_index": "sophiemasure/twitterhandle",
                "verb": "tweets_link",
                "verb_category": "tweets_link",
                "entity2": "http://instagram.com/p/ry-q1buq5y/",
                "entity2_index": "http://instagram.com/p/ry-q1buq5y//url",
                "assoc_type": "Event"
            },
            {
                "entity1": "sophiemasure",
                "entity1_index": "sophiemasure/twitterhandle",
                "verb": "tweets_link",
                "verb_category": "tweets_link",
                "entity2": "http://instagram.com/p/ry-j8roq6c/",
                "entity2_index": "http://instagram.com/p/ry-j8roq6c//url",
                "assoc_type": "Event"
            }],
            "metadata": {
                "json": [{
                    "_id": "52e079a7e4b08dc56ad49806",
                    "center": {
                        "lat": "40.74415536",
                        "lon": "-73.9989422025"
                    },
                    "count": "4",
                    "event": "false",
                    "key": "405:-740",
                    "locationBot": "false",
                    "locationBotIndex": "0.75",
                    "maxTime": "Tue Oct 30 02:49:41 UTC 2012",
                    "mergeIterations": "0",
                    "minTime": "Tue Oct 30 02:22:00 UTC 2012",
                    "significantTerms": {
                        "clusterScores": {
                            "D(TIMEKEY)": "88134.0",
                            "SUM(TF)/(TWEETS_COUNT*3)": "0.2222222222222222",
                            "SUM(TF* LOG(D(TIMEKEY)/D(T,TIMEKEY)))/(TWEETS_COUNT*3)": "0.6614578548224747",
                            "SUM(TF* LOG(D(TIMEKEY)/D(T,TIMEKEY)))/(TWEETS_COUNT*3*LOG(D(TIMEKEY)))": "0.058090831429314774",
                            "SUM(TF* LOG(D/D(T)))/(TWEETS_COUNT*3)": "0.7255758028554147",
                            "SUM(TF* LOG(D/D(T)))/(TWEETS_COUNT*3*LOG(D))": "0.05261305651869126",
                            "SUM(TF*D(TIMEKEY)/D(T,TIMEKEY))/(TWEETS_COUNT*3)": "4.36004749183734",
                            "SUM(TF*D/D(T))/(TWEETS_COUNT*3)": "5.818332543111803",
                            "SUM(TF*D/D(T))/(TWEETS_COUNT*3*D)": "5.963936078533111E-6",
                            "significantTermsCount": "1.0",
                            "uniqueAuthors": "3.0"
                        },
                        "significantTerms": {
                            "TF*LOG(D(TIMEKEY)/D(T,TIMEKEY))": {
                                "nyc": "5.953120693402272"
                            },
                            "TF*D(TIMEKEY)/D(T,TIMEKEY)": {
                                "nyc": "39.240427426536066"
                            },
                            "TF*D/D(T)": {
                                "nyc": "52.36499288800623"
                            },
                            "TF*LOG(D/D(T))": {
                                "nyc": "6.530182225698732"
                            }
                        },
                        "significantTermsTF": {
                            "nyc": "2"
                        },
                        "timeKeysToDocCounts": {
                            "2012930-0": "88134"
                        }
                    },
                    "taskAttemptId": "attempt_201401170201_0051_r_000000_0",
                    "tweets": ["Lane Savage [40.74561836:-73.99911931:Tue Oct 30 02:22:00 UTC 2012] \u003d\u003e NYC sleeps after all. #HurricaneSandy http://t.co/gPNWt2Ph",
                    "Jonathan C. Zaback [40.74158172:-73.99917718:Tue Oct 30 02:33:03 UTC 2012] \u003d\u003e BREAKING: The water level at the Battery in #NYC has reached 11.25 feet, surpassing the all-time record of 11.2 feet set in 1821. #Sandy",
                    "Sophie Masure [40.74471068:-73.99873616:Tue Oct 30 02:47:04 UTC 2012] \u003d\u003e NYC #blackout #sandy  @ Chelsea http://t.co/zrCyxMKN",
                    "Sophie Masure [40.74471068:-73.99873616:Tue Oct 30 02:49:41 UTC 2012] \u003d\u003e Out street #blackout #sandy  @ Chelsea http://t.co/ZGWI4vGS"]
                }],
                "rawDocs": []
            }
        }]    
}