Configuring GSA(Google Search Appliance) in ASP.NET MVC Application - c#

I am using GSA for my application.I want to display promoted results as part of my application.Can any one suggest me in which way i can use OneBox for the getting promotted results.In which way i can configure it in GSA Admin Console?What type of results i will get on application from the service?

Have you looked at keymatches? That's how you normally handle promoted results with the GSA.

Related

Using Application insight API to extract telemetry data in web application

I wanted to extract users count from application insight inside my web application and was going through the document for the rest API
https://dev.applicationinsights.io/
I am not sure if API response contains user count?If this is not the way is there a way to get data specifically user count from app insight?
Have you tried
GET /users/count
check the title
Metric metadata: getting a list of metrics under Default metrics.

Sessions or any alternatives in webAPI

I have a business logic which has lot of DB fetch operations and a bit complex business logic.
Data fetched is rarely changed within the session of user.
Many Fetch opertaions(data fetched is rarely changed within the session of user).
For each and every action on the form(button click/ value change in Textbox etc...) we need to run the business logic to check if it's valid change.
Currently we are using Asp.net Forms Application and these business logic is in InSessionScope().
Currently we are working on migrating to Restful API(WebAPI).
Can we use sessions(InSessionScope()) in RESTFul?
If not in sessions how to avoid more database calls and use the same object on subsequent calls and increase performance?
Based on my personal experience NEVER use Session in a Rest Application as AspNET WebAPI are .. even if you can .. but instead use Tokens for Authorization and User Profilation (with AspNet Identity) and for performance (don't hit DB too many times) i suggest to you some ways as i have done:
1 - USE CACHE!! (there are some great frameworks and lib for cache ..you can use different Layers of cache .. Query .. Response of webapi ..for example I'm use to cache the entire API response (Json) and auto invaildate it on POST / PUT / DELETE request) ..in .NET you can use this https://github.com/filipw/Strathweb.CacheOutput
You can also use Redis for caching (if you don't want to cache locally in the Server but to have a distribuited cache)
2 - Try to think in NoSQL way .. in our application we use a mix of DB .. SQL Server but also MongoDB (expecially for big amount of data ) for example we use SQL server to manage AspNEt Identity but we use MongoDB to store our Product (we have about 6 milions of products) and it take about 1 sec for query (also with aggregation!!) ..
3 - Try to use LocalStorage on the FrontEnd if you can to store some information. .and then sync them when you need ..
Hope it can help you.. enjoy WebAPI ..enjoy REST!! (and leave webforms as soon as you can ...in my idea!!)
You can use tokens implemented by you or JwtToken.
If you choose implement custom token on login method you must return a token to you app, next in any api call pass this token like a header or query string and decrypt in server to validate propose.

ways to enter data in another website and get revert from there

I m looking for some code to enter data in another website without API,
Front end should be my website and in back end automatically the data enters in the another website and get revert from there and give me the message/proper content in my website..
So is there any type of code is available for that in c#??
Guys please suggest me if there is any way to do this.
I tried some web services but it didn't helped.
Just a suggestion : You can have a single database for both of your web sites. from one site you can insert the data and you can use other website to retrieve it.

ASP.NET Get all user sessions for web application

I need to find a way to retrieve all of the user sessions from within a web application.
I have tried this solution:
Get a list of all active sessions in ASP.NET
And it worked fine for .net 4.5 and above but not for 4.0 and below.
I don't want to manage my sessions by creating a static list of sessions that will be populated from Global.asax (session_start and session_end). I just need to find a way to investigate the current web application and retrieve all of the users active sessions (for .net versions 2.0 and above)
Is it possible?
You could use a SQLServer SessionState Store Provider and then get the stored sessions from the database. Or implement your own custom Provider. Both options seem like a little overkill comparing to a simple session_start/session_end you mentioned.
did you mean that , you have a, b , c three uses in different pc using same application through iis, and you need to access all user session from on of pc.
then you may need to use save the session in state server. rather then apllication sate.
then you may try follwoing code. it may be work
for (int i = 0; i < Session.Count; i++)
{
Session[i].ToString();
}
i am not sure. hope this will help you.

How to search the web with Google Search API without limit

I need a web search be my app and it would be fine to use google web search for.
This works in different cases when I do the code by myself or use assemblies like GAPI.
The problem is that I ever get an error because of paging the results:
ResponseStatus: 400, Reason: out of range start
About this problem I found this by the GAPI developer:
Google AJAX Search API does not allow more than 64 results (e.g. max page is 56).
But I need more results as this is to less for my usage I need at least 500...
Is there another way to get more result by searching the web?
It looks like GAPI is using the old Google Search API which has been officially deprecated as of November 1, 2010.
If you want more results you should look into another library or implementing your own using the Google Custom Search API:
https://developers.google.com/custom-search/v1/overview

Categories

Resources