Sunday, December 20, 2009

The filtering process could not load the item. This is possibly caused by an unrecognized item format or item corruption.

I was constantly getting this error while running Crawl on my “All local portals”. Earlier I suspected it could be due to .doc IFilter not properly registered. But after verifying that all the registry entries are intact as per the MSDN, I thought of troubleshooting it in more detail.

Even when I removed all document libraries and word files from my site, I was still getting the same error. I still don’t know why this error is occurring. But I was able to get my .doc file indexing using a workaround.

 

Create a new Content Database with only your site which contains the .doc,.docx or .pdf document libraries. As shown in the below snapshot

image

The trick here is to minimize the Scope instead of having a wide scope of the entire Web Application like http://manmoss:2222/ in this case. Only crawl only the new subset Content database. You’ll get success in Crawl Logs

 

Sunday, December 13, 2009

Your search cannot be completed because of a service error

 

If you get the below error while performing a search from “Search box” of SharePoint

Error :: Your search cannot be completed because of a service error

The solution that worked for me to fix this error was to give sufficient privileges (EXECUTE,READ,WRITE,etc) to your SharePoint Service Account  on your SSP’s search database.

Normally this service account can be classified as <Domain>/<SharepointComputerName>$

e.g. if your domain name is OrgCorp.com and your sharepoint machine name is SPComp then the user will be OrgCorp/SPComp$

In my case the account name is MANCORP/MANMOSS$ and here’s how the DB setup looks like

image

Wednesday, May 20, 2009

Stop hyperlink href browse

Suppose a scenario comes where you have a Javascript onclick event defined on a hyperlink which performs some action and you want to prevent the hyperlink to browse the URL specified in the href. By default, first onclick script is executed then hyperlink takes you to the href webpage. If you want to suppress the later, the technique to do this is using jQuery. In the post, I assume you know ABC of jQuery and know how to include it and refer it.

 

Now take example of the following markup

<span>


<a href="http://www.example.com/" id="lnk">The quick brown fox jumps over the lazy dog. </a>


</span>




And you have jQuery event hooked to it and you want only that to execute but not the link browsing. Here's the code for that which achieves it through the preventDefault() method.



<script type="text/javascript">
$(document).ready(function() {
$('#lnk').click(function(event) {
alert('It wont take you to the webpage');
event.preventDefault();
});

});
</script>



 



I have described a similar scenario on event bubbling in my previous post









Stop JavaScript event bubbling

JavaScript performs event bubbling in the sense that when an event like omouseover, onclick, etc occurs in the child controls it is raised for the containing controls also till the outermost parent containing control. Suppose we have a HTML structure like this

   1:  <div id="blockDiv"> 


   2:       <span><a href="http://www.example.com/">The quick brown fox jumps over the lazy dog. 


   3:              </a>


   4:       </span> 


   5:        <p> 


   6:              Nothing much


   7:        </p> 


   8:   </div>




 



where Div is the parent control containing span which further contains a (link). Now when onmouseout occurs on a (link) after we take our mouse pointer out of it, 2 more events fire at the same time. onmouseout of span as well as onmouseout of div. This is the called event bubbling and the default behaviour of JS. If you have some script written on these 2 mouseouts, it will unnecessarily fire.



 



How to stop this: Its quite easy to via the stopPropagation() method in JS



function aout (event){

//Do something on a link mouseout

event.stopPropagation();

}