Hello! Here is the code i'm workin on (see line 3 in the code as i need the word "flom" to change into what I write in the search box.
The code is working when I use a button for each word. I have to copy this part of the code and change the word "flom" to another keyword in order to have more options on what to search for. But I want to be able to use a search box where i can type any word to search for, not one or 1000 +++ buttons!
Can you please tell me exactly what i have to do in order to get this word to change into what i type in the search box? I tried for 23 hours now :( THANK YOU!!!!
public static XXDatabase GetDatabase(){
QueryTest = "flom";
System.Console.WriteLine(QueryTest);
XXXServerSettings settings = new XXXServerSettings();
settings.Server = new XXXServerAddress("X.X.X", XXXXXX);
XXXServer server = new XXXServer(settings);
XXXDatabase database = server.GetDatabase("tweet_database");
var collection = database.GetCollection<Tweets>("docs");
System.Console.WriteLine("5");
var query = Query.Matches("text", QueryTest); //Should probably be something like Matches("text", "searchFromTextBoxInMainWindow.xaml")
//Another option is trying to make the searchbox update QueryTest.
System.Console.WriteLine("6");
var cursor = collection.Find(query).SetFields(Fields.Exclude("_id", "retweeted", "retweet_count", "followers_count", "contributors", "truncated", "in_reply_to_status_id","id", "favorite_count",
"source", "coordinates", "entities", "symbols", "user_mentions", "indices", "id_str", "name", "hashtags", "urls",
"media", "source_status_id_str", "expanded_url", "display_url", "url", "media_url_https", "source_status_ID", "sizes",
"h", "resize", "w", "large", "medium", "thumb", "in_reply_to_screen_name", "favorited", "retweeted_status", "in_reply_to_user_id",
"user", "follow_request_sent", "profile_use_background_image", "default_profile_image", "verified", "profile_image_url_https", "profile_sidebar_fill_color",
"profile_text_color", "favourite_count", "profile_sidebar_border_color", "profile_background_color", "listed_count", "profile_background_image_url_https",
"utc_offset", "statuses_count", "description", "friends_count", "location", "profile_link_color", "profile_image_url", "following", "geo_enabled",
"profile_background_image_url", "lang", "profile_background_tile", "favorites_count", "notifications", "created_at", "contributors_enabled",
"time_zone", "protected", "default_profile", "is_translator", "geo", "in_reply_to_user_id_str", "possibly_sensitive", "storage_time", "filter_level",
"in_reply_to_status_id_str", "place", "disconnect"));
cursor.SetLimit(100);
System.Console.WriteLine("7");
//Puts the result from the last query into a list.
var resultList = cursor.ToList();
//Iterates over the previous mentioned list and inserts the content into the ObservableCollcetion created earlier.
foreach (var item in resultList)
TweetOC.Add(item);
System.Console.WriteLine(TweetOC.Count);
return database;
}
}
}