your link to better business solutions

Sitecore Lucene Search Index

Sitecore has been using Lucene search since version 5, which used the Sitecore.Data.Indexing namespace and Sitecore -> Indexes section in the Web.Config.

Starting in Sitecore 6.4, they introduced a new Search namespace – Sitecore.Search, this uses the Sitecore -> Search -> Configuration -> Indexes section in Web.Config.

From what I know, Sitecore recommends using the new namespace and the old namespace is going to be deprecated starting Sitecore 6.5. The following is a blurb from Sitecore 6.5 Release notes from SDN:
“The Sitecore.Data.Indexing namespace has been deprecated and will be removed in a future version of the CMS in favor of the more powerful and flexible Sitecore.Search classes and corresponding index definitions. “

Since there is only one document on this new namespace, it’s difficult to get more information when you find yourself in a bind. I had to google search to find bits and pieces and so I am writing this post.

Here is the link to the PDF on this site. Click Here (NO SDN access needed)

The basic configuration is given below:

      <configuration type="Sitecore.Search.SearchConfiguration, Sitecore.Kernel" singleInstance="true">
        <indexes hint="list:AddIndex">
          ... ... ...
          <index id="IndexNAME" type="Sitecore.Search.Index, Sitecore.Kernel">
            <param desc="name">$(id)</param>
            <param desc="folder">im_index</param>
            <Analyzer ref="search/analyzer"/>
            <locations hint="list:AddCrawler">
              <master type="Sitecore.Search.Crawlers.DatabaseCrawler, Sitecore.Kernel">
                <Database>master</Database>
                <Tags>master content</Tags>
                <Root>/sitecore/content</Root>
                <IndexAllFields>true</IndexAllFields>
                <include hint="list:IncludeTemplate">
                  <template comment="Template1">{8917CADF-2148-4328-B595-217C5A9CCA7D}</template>
                  <template comment="Template2">{2A18027D-CA51-4E5D-A7C1-51096E09C16C}</template>
                </include>
                <include hint="list:ExcludeTemplate">
                  <template>{8C18027D-CA51-4E5D-A7C1-510965555C}</template>
                </include>
                <!--<include hint="list:IncludeField">
                  <fieldId>{GUID}</fieldId>
                </include>-->
              </master>
            </locations>
          </index>
        </indexes>
      </configuration>

Here is a piece of sample code to query the index:

    Sitecore.Search.Index searchIndex = Sitecore.Search.SearchManager.GetIndex("Search Index Name"); //replace string with the name of the search index
    using (IndexSearchContext context = searchIndex.CreateSearchContext())
    {
        SearchHits hits = context.Search("search string");  //replace string with the actual search string
        SomeRepeater.DataSource = hits.FetchResults(0, 25); //first param is the start item, second is the count
        SomeRepeater.DataBind();
        ResultsCount = hits.FetchResults(0, hits.Length).Count();
    }

Here are some useful links:

Search Index Troubleshooting by Alex Shyba

Index Viewer in Sitecore Shared Source

 

I hope this is useful. If you have any questions please don’t hesitate to get in touch!

What Does a Verizon iPhone Mean to You?

The long rumored partnership between Verizon and Apple is reportedly just around the corner. It is supposed to become reality for the consumer in early 2011.

Whatever you think about Apple and its methods, the iPhone is undeniably huge. Still, Apple had to step out from its exclusive AT&T contract because of top flight competition from Android phones.

With the world’s largest networks and distribution system in Verizon, Apple opens itself up to a market that previously wouldn’t look at an iPhone. Completely realistically, iPhone sales could double under a Verizon contract.

This also opens up the possibility of a iPhone that takes advantage of Verizon’s 4G LTE service, coming to 38 cities and 60 airports by the end of the year. With significantly faster download rates, better penetration through buildings and walls, and an extensive initial rollout, the LTE service could have a significant impact on mobile services. I expect a whole new brand of user to embrace smartphone and mobile technology.

What does this mean to the business market? It means that if you haven’t jumped onto the mobile bandwidth, so to speak, you’ll want to look now at making your website and online presence mobile-device friendly.

It won’t take long for other carriers to have their own version of Verizon’s LTE service online. Once the standard has been raised, they can’t afford to fall behind. Meanwhile, although some of the new Verizon iPhone users will transfer from other smartphones, including Android phones, many will be first time smartphone users. We’re going to see another significant upsurge in mobile device users next year, and we’ll keep piling them on after that.

I see a day when mobile is the norm, and we’re getting there quickly. Make sure your business is on board.

Google Scores “Instant” Home Run

While Bing by Microsoft seemed to some like a huge step forward in the search world, Google’s Instant is a whole new world of search.

Rendering the “enter” key nearly useless, Instant anticipates your query and combines its Google Suggests recommendations that would appear as you typed in past queries with an instant live search for those queries as you type.

Google advertises a 2 – 5 second time savings per search, and “smarter” predictions that allow you to find what you’re actually looking for faster. The results are, according to Google, automatically localized, giving you relevant results each time, without having to type in limiting words or phrases.

Once again, Google has defined the paradigm for search.

Will this be enough to counter the bad publicity over privacy intrusions by a Google Site Reliability Engineer David Barksdale? This latest security breech and the perception of a “hush hush” handling of the problem (Barksdale was “quietly” fired) adds to the perception that Google may be careless with security.

It’s a concern, but not a major one. Google is keeping careful tabs on its business and its business model. They are on top of what is going on in the search engine business in particular and the cloud computing business in general.

Because of Google’s continual innovation and leaps ahead of the technology curve, I predict that Google, Google Instant, Android, Apps, Gmail and all the other innovative Google features will become even more popular in coming months and years.

Sitecore – Upload to Media Library Issue/Problem

Recently I had an issue while importing few thousand images and documents into the Sitecore Media Library. I had the following settings in Web.Config:


<!--  UPLOAD AS FILES
Determines if media should be uploaded as files or as database blobs.
Default: false
-->

<setting name="Media.UploadAsFiles" value="false" />

<!--  MEDIA - USE ITEM PATHS FOR URLS
This setting controls if item paths are used for constructing media URLs.
If false, short ids will be used.
Default value: true
-->

<setting name="Media.UseItemPaths" value="true" />

Each time, it would import only a few files and it would stop. I tried killing all processes, lower the CPU and Memory usage but that didn’t make any difference.

According to the friendly and helpful Sitecore Customer Service Rep, Upload folder is managed by Sitecore.Resources.Media.UploadWatcher. Each time a file is added to the upload folder, UploadWatcher creates similar structure in media library. It is not a separate task or webservice, just simple uploading job started by “Created” event on filesystem.

The reason for this issue is that Sitecore uses System.IO.FileSystemWatcher object for file uploading (Sitecore use it to watch changes); when a lot of files are added at once, the FileSystemWatcher’s internalBuffer fills up and starts skipping files.

Checkout this article http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx

As a result of my Ticket, they created a workaround which is available at http://sdn.sitecore.net/scrapbook/sitecore%20doesn%E2%80%99t%20upload%20files%20from%20upload%20folder.aspx. You would need a Sitecore developer account to login.

As a workaround you need to use Sitecore.Support.322918.dll file. The workaround increases the InternalBuffer to avoid the unexpected skipping of files.

1. Add the string <add type=”Sitecore.Support.UploadWatcher,Sitecore.Support.322918″ name=”SitecoreUploadWatcher”/> before each occurrence of the string <add type=”Sitecore.Resources.Media.UploadWatcher, Sitecore.Kernel” name=”SitecoreUploadWatcher”/>

(see <system.webServer>/<modules> section and <system.web>/<httpModules> section)

2. Comment out all such lines: <add type=”Sitecore.Resources.Media.UploadWatcher, Sitecore.Kernel” name=”SitecoreUploadWatcher”/>

3. Put the Sitecore.Support.322918.dll file into the /bin folder of your web site

4. In the web.config file, add the following string under the <settings> section

<setting name=”FileSystemWatcherBufferSize” value=”4096000″/>

Such value seems to be enough for 5000 files, but you can increase it further to be sure that even files with very long names are uploaded.

For example:

If the full file path contains 100 symbols, it takes 200 bytes, 32000 files will take 6400000 bytes (6250 kb), so the setting value should be:

<setting name=”FileSystemWatcherBufferSize” value=”6400000 “/>

As always, please backup before making any significant changes.

P.S.: UploadWatcher calls MediaManager.Creator.FileCreated(filePath); – you can try to fire the same method with path to the missing folder as parameter. There is another methos for FolderCreated as well.

Hope this helps. Credit goes to Sitecore and its Customer Service Reps.

Business Promise Trumps Privacy Concerns for Facebook Places

While some “mature” consumers may question the appeal of Facebook’s Places application – the program that allows a user to “check in” and let friends or others know where they are at any given time – savvy marketers see the application as a great way to reach a highly desirable demographic.

Places largely appeals to a younger crowd. Since it can only be used by those with a Facebook app on their smart phones, it eliminates many traditional consumers.

However, for companies attempting to reach the elusive younger crowd, those who spend little time listening to the radio, reading mailers or newspapers, or clipping coupons, these location based applications may become a gold mine.

If the customer is willing to allow a business to view their location, nearby businesses can instantly offer coupons or deal, grabbing the consumer at the point of making a purchase decision.

Businesses could also make offers to friends of those who check in, encouraging them to join their friends at a particular location and make a purchase.

Facebook has already announced its intention to allow restaurants and other retail locations to “claim” their locations. This would allow them to direct targeted advertising to frequent customers.

Need some ideas for some virtual offers you can make on location Facebook Places? John Jantsch at http://www.ducttapemarketing.com/blog/2010/09/07/5-ways-for-small-businesses-to-get-in-the-location-game/ has some ideas for using rewards programs, group buying, coupons via Goodle places, mobile coupon networks, or social location games to bring customers into your door.

With only a fraction of Facebook’s users even tuned into Places, you certainly don’t want to make it your primary source for advertising. But with a growing number of younger consumers “checking in,” you don’t want to ignore it, either.


Android takes Over Smart Phone Market

I’ve been touting the benefits of Android for a while now, and now smart phone users around the world have caught that Android fever.

In August, Android shipments beat out iPhone shipments for the first time, which is important for business owners and developers. DigiTimes reports that Android shipments around the world will surpass 55 million.

If that’s true, it means a 561 percent growth over last year’s shipments.

You want to keep posted on smart phone sales so you can not only choose the platform to use for your personal and business phone, but also so you can develop apps for the most popular phone platforms.

You want to focus attention on the phones that are growing the fastest and look to have the longest staying power – complicated apps can take up to 6 months to develop, and as with all technology products, you’ll want to stay ahead of the curve, not behind. Now, iPhone apps are still a huge portion of the market, so you don’t want to ignore the platform, but Anroid is a force that looks to have staying power, at least for the foreseeable future. As Android grows, developers and hardware manufacturers are undoubtedly going to focus more attention and more resources on the platform, making it a solid choice for future projects.

One development you will want to watch for is more countries open to purchasing Android apps. Currently, customers in only 13 out of 46 countries that sell Android phones can actually purchase applications for the phone.

In order to grow the Android market, Google will need to find a way to fix that little problem.