Friday, December 18, 2009

Search on your ASP.NET Website

Many people just don't realize that some most trivial things in IT-life are not that "out-of-the-box-y" at all.
One of them is "Search". Many sites have a Search function, so it is easy to do, right?

I have summarized the approaches to "Search" here:
a. Do your own site search - host it on your server
b. Integrate external search (like Google)

In case of [a] from above: MS indexing service is really a piece of turd when it comes to web indexing, pardon my French, reason being - it does not turn your ASPX files
into static content, it was never built for that so you end-up with an index of your C# code or any other server-side markup.
I know a few people who have "materialized" ASPX and other ASP resources into "/static" folder ,then unleashed MS Indexing on it, then when MS indexing gives you result
, remap "static.html" back into "dynamic.aspx" , and this does suck, but it does work as well!
Another approach in [a] case from above - Google for "ASP.NET indexing" and go buy a dedicated ASP.NET solution of your problem, this sux a ton :(

Now, when you want to utilize Sergey and Larry in [b] case from above, there are quite a few cool features:
if you don't care about how your search result looks - just create a plain HTML form post back to Google with site search parameter preset to your domain.

If you are fastidious as to how search results are "branded" - Google for "Google Search API" and indeed you can customize it, but, what not that many people know, there is a
REST service that returns plain JSON, even with a callback! So, if you are a fan of JQuery, here is a code for you:

$.ajax({  type: "GET", url: "http://ajax.googleapis.com/ajax/services/search/web?v=1.0",
data: {q: $("#YOURTEXTBOXID").val(),
callback: "resultReady",
context: "doSearch",
cx: "YOURCUSTOMSITEID",
rsz: "large"}, dataType: "script"
});
and finally:
     function resultReady(ctx, data)
{
for (var i in data.results)
{
data.results[i].....do your stuff dynamically
}
}

Google for "Custom Search Engine" to get "YOURCUSTOMSITEID", basically this will allow you to set-up a profile that will
filter searches to URLs that you specify - just what we have needed for a long time!

That's IT!

Remember to check GOOGLE Terms and comply with their logo and other requirements.



18 comments:

Anonymous said...

great post comrade, yo
$$$buratino$$$

Anonymous said...

how are you I was fortunate to find your blog in wordpress
your post is quality
I get a lot in your subject really thank your very much
btw the theme of you site is really impressive
where can find it

Anonymous said...

nice post. thanks.

Anonymous said...

I really love your site.. Pleasant colors & theme. Did you create this site yourself?
Please reply back as I'm attempting to create my own site and would love to know where you got this from or just
what the theme is named. Many thanks!

Look into my blog post panic attacks and menstrual cycle

Anonymous said...

TҺis is why it's important to work with a specialist.
Your genes are certainly not solely responsible needed for youг weigҺt then metabolism.
1)WORK BODYWEIGHT EXЕRCIՏES BEFORE ADDING ɌESISTANCE.


mу blog pօѕt: turbulence training download 2014

Coach Factory said...

louboutin outlet, michael kors handbags clearance, air jordan, oakley vault, burberry outlet online, kate spade handbags, louis vuitton handbags, michael kors outlet online, ray ban sunglasses, cheap oakley sunglasses, michael kors outlet online, toms shoes, prada outlet, true religion outlet, jordan shoes, coach purses, longchamp handbags, michael kors outlet, polo ralph lauren outlet online, coach outlet store online, nike free, tiffany and co, polo ralph lauren outlet, prada handbags, oakley sunglasses, nike air max, longchamp handbags, true religion, nike free, kate spade outlet, nike shoes, tory burch outlet, nike air max, louis vuitton outlet online, coach outlet, coach factory outlet, true religion jeans, ray ban sunglasses outlet, air max, longchamp outlet, air max, gucci outlet, louboutin, cheap michael kors, chanel handbags

Coach Factory said...

lululemon outlet, ray ban, nike roshe, mont blanc, converse shoes, karen millen, michael kors, roshe run, nfl jerseys, nike huarache, birkin bag, beats by dre, mac cosmetics, hogan, louboutin, converse pas cher, ray ban pas cher, montre pas cher, michael kors, vans, north face jackets, lululemon, oakley pas cher, north face outlet, reebok outlet, michael kors, nike free, ralph lauren, nike trainers, louis vuitton, louis vuitton, hollister, hermes, timberland, abercrombie and fitch, supra shoes, new balance shoes, juicy couture outlet, mulberry, air max, lancel, hollister, north face, rolex watches, juicy couture outlet, burberry, wedding dresses, new balance pas cher, abercrombie and fitch, nike air max

Coach Factory said...

nike air max, air max pas cher, p90x3, converse, ugg boots, ferragamo shoes, giuseppe zanotti, louboutin, moncler, mcm handbags, air max pas cher, ralph lauren, ugg outlet, soccer jerseys, valentino shoes, herve leger, babyliss pro, moncler, moncler, jimmy choo, vans, asics gel, air max, moncler outlet, chi flat iron, canada goose outlet, uggs on sale, hollister, canada goose, instyler ionic styler, moncler, canada goose, insanity, marc jacobs, tn pas cher, ray ban, canada goose outlet, air max, soccer shoes, canada goose, bottega veneta, ghd, ugg, celine handbags, ugg, gucci, canada goose, ugg boots, oakley

mao yun said...

1
instyler ionic styler
cheap soccer jerseys
tiffany and co jewelry
ghd hair straighteners
louboutin shoes
valentino sale
asics running shoes
adidas shoes
hollister
michael kors outlet online
jordan 4
insanity
christian louboutin
air jordan concord
giuseppe zanotti sale
cheap nba jerseys
insanity max 30
lacoste outlet
abercrombie and fitch
soccer jerseys
salomon running shoes
christian louboutin outlet
coach outlet store online
toms outlet
hollister clothing store
toms outlet
kate spade handbags
polo lacoste pas cher
cheap snapbacks
adidas outlet
babyliss
fred perry sale
christian louboutin outlet
pandora charms
discount oakley sunglasses
mlb jerseys wholesale
salomon shoes
ralph lauren outlet
converse outlet
ray ban aviator sunglasses
michael kors uk
20150326maoqiuyun

oakleyses said...

kate spade outlet online, nike air max, tory burch outlet online, ugg boots clearance, prada handbags, nike air max, ray ban sunglasses, michael kors handbags, chanel handbags, jordan shoes, nike outlet, longchamp outlet online, gucci handbags, christian louboutin, christian louboutin shoes, burberry outlet online, ugg outlet, oakley sunglasses, louis vuitton outlet, ray ban outlet, nike free, cheap oakley sunglasses, cheap ugg boots outlet, louis vuitton, longchamp outlet, michael kors outlet online, polo ralph lauren outlet, burberry outlet online, christian louboutin outlet, michael kors outlet online, oakley sunglasses, ray ban sunglasses, oakley vault, ugg australia, cheap ugg boots, red bottom shoes, replica watches, michael kors outlet, tiffany and co, tiffany jewelry, louis vuitton outlet online, replica watches, polo ralph lauren, prada outlet, louis vuitton handbags

oakleyses said...

guess pas cher, nike air max, nike roshe run, mulberry uk, coach outlet, true religion outlet, true religion outlet, new balance pas cher, abercrombie and fitch, longchamp, nike air max, scarpe hogan, air max pas cher, sac vanessa bruno, ray ban pas cher, nike roshe, north face, coach purses, burberry pas cher, nike free pas cher, lacoste pas cher, timberland pas cher, coach outlet, michael kors uk, michael kors, nike free, longchamp pas cher, tn pas cher, hollister uk, vans pas cher, true religion jeans, ray ban uk, true religion, michael kors outlet online, north face pas cher, hermes pas cher, air jordan, lululemon outlet online, hollister, michael kors canada, louboutin, nike blazer pas cher, kate spade outlet, coach outlet store online, oakley pas cher, converse pas cher, nike air force, ralph lauren uk, air max, ralph lauren pas cher

oakleyses said...

nike air max, longchamp, new balance outlet, oakley, mcm handbags, nike roshe, ferragamo shoes, nfl jerseys, asics shoes, ralph lauren, celine handbags, mont blanc pens, hollister, s6 cases, baseball bats, soccer jerseys, nike air huarache, p90x workout, hollister clothing store, bottega veneta, giuseppe zanotti, insanity workout, abercrombie and fitch, ghd, iphone cases, valentino shoes, mac cosmetics, herve leger, iphone 6 cases, iphone 5s cases, lululemon outlet, instyler ionic styler, north face jackets, vans outlet, wedding dresses, soccer shoes, north face jackets, jimmy choo shoes, iphone 6s plus cases, birkin bag, beats headphones, timberland boots, nike trainers, iphone 6 plus cases, louboutin, reebok shoes, babyliss, chi flat iron

oakleyses said...

pandora jewelry, swarovski uk, canada goose, moncler outlet, links of london uk, coach outlet, ugg boots, hollister canada, sac lancel, marc jacobs handbags, air max, pandora jewelry, converse, replica watches, vans, wedding dress, uggs outlet, canada goose pas cher, canada goose, uggs canada, louis vuitton uk, moncler, barbour, gucci, supra shoes, moncler outlet, canada goose, canada goose outlet, doke gabbana outlet, moncler, juicy couture outlet, sac louis vuitton, canada goose, canada goose outlet, montre femme, thomas sabo uk, ugg soldes, louis vuitton, louis vuitton pas cher, moncler, swarovski jewelry, michael kors outlet online, louis vuitton canada, barbour jackets, converse shoes, ugg, canada goose outlet, ugg, ray ban, karen millen, moncler

mmjiaxin said...

ferragamo shoes
michael kors outlet
rolex watches outlet
tory burch outlet online
michael kors handbags
coach outlet store
mac cosmetics
michael kors outlet online
wellensteyn outlet
michael kors outlet
canada goose outelt
air max 2014
ray ban,rayban,occhiali ray ban,ray-ban,ray ban occhiali,ray ban sunglasses
woolrich outlet store
fred perry polo shirts
michael kors outlet
tiffany outlet
canada goose jackets
oakley outlet store
mizuno running shoes
mm1202

方松腾 said...

ugg boots
cheap oakley sunglasses
true religion sale
air jordan 11 free shipping
toms outlet
louis vuitton outlet
michael kors outlet,michael kors outlet online,michael kors,kors outlet,michael kors handbags,michael kors outlet online sale,michael kors handbags clearance,michael kors purses,michaelkors.com,michael kors bags,michael kors shoes,michaelkors,cheap michael kors
north face jackets
ferragamo shoes
soccer jerseys,soccer jerseys wholesale,soccer jerseys cheap,soccer jerseys for sale,cheap soccer jersey,usa soccer jersey,football jerseys
ugg boots on sale
vans sneakers
oakley sunglasses
fitflops outlet
coach outlet online,coach purses,coach handbags,coach bags,coach handbags sale,coach handbags outlet

Cran Kate said...

Tory Burch Flats Marc Jacobs Handbags Jimmy Choo Shoes Jimmy Choos True Religion Outlet ED Hardy Outlet
Burberry Belt Tory Burch Boots Louis Vuitton Belt Ferragamo Belt Marc Jacobs Handbags Lululemon Outlet Christian Louboutin Shoes True Religion Outlet Tommy Hilfiger Outlet
Michael Kors Outlet Coach Outlet Red Bottoms Kevin Durant Shoes New Balance Outlet Adidas Outlet Coach Outlet Online Stephen Curry Jersey Vans Outlet Ralph Lauren Outlet
Ugg Boots Sale UGGS For Women Skechers Go Walk Adidas Yeezy Boost Adidas Yeezy Adidas NMD Coach Outlet North Face Outlet Ralph Lauren Outlet Puma Outlet Polo Outlet

Unknown said...

carolina jerseys
texans jerseys
tiffany and co
instyler max
hermes belts
michael kors handbags
seahawks jersey
michael kors outlet
the north face outlet
replica watches

Unknown said...

nike trainers uk
ecco shoes
oakley sunglasses
louis vuitton sacs
san diego chargers jerseys
michael kors handbags
asics shoes
adidas nmd
ralph lauren pas cher
michael kors handbags wholesale