Tuesday, May 17, 2011

Search Error – ‘Cannot create a file when that file already exists


When try to start manual crawl got following error
Error:
‘Cannot create a file when that file already exists’ upon trying to run an index
Event view log:
The Execute method of job definition Microsoft.Office.Server.Search.Administration.IndexingScheduleJobDefinition (ID 31df2d41-6991-4fe7-8e4b-683c913cdbe5) threw an exception. More information is included below. Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
ULS log:
CGatherer::CreateCrawlFromStartAddressList: CRAWL_ACQUIREID failed. m_dwProjectID=1, dwCrawlStatus=5 – File :\office\source\search\search\gather\server\gatherobj.cxx Line:6562
Resolution:
  • Check service account for “Office SharePoint Server Search” in services.msc.
  • Change it to “Local System Account” or use Farm Admin account to run the service.
  • Restart the OSearch service from service.msc and also from Central Admin.
Please let me know in case of any queries.

Exclude crawling content based on creation date


Scenario:
One of my colleagues wants to exclude file / documents from the search result based on their creation date.
Steps taken to achieve:
There is a provision in MOSS 2007 to exclude specific contents from indexing using Crawl Rule. But it’s not possible to exclude contents based on creation date.
We have set - Information management policy on a doc lib and set Expiration policy which will start the workflow and move documents to another doc lib (i.e. Archive) based on their creation date
(To create custom workflow to move doc from one lib to another please refer
And on Archive Doc Lib select “No” to appear in search result option which will not crawl the content of that doc lib.

Question sequence is disordered when we export a survey list to excel

Issue:


Question sequence is disordered when we export a survey list to excel

Resolution – Only to get questions in proper sequence in Excel sheet!!


  • Checked Survey settings

  • Found there were total 50 questions and found almost 30 questions were created using“Rating Scale“ category

  • Changed question ordering from Survey settings > Change order of questions

  • Previously it was from Q-1 > Q-1-a….Q-5 > Q-5-e

  • Changed it to reverse order and arranged Q-5-e > Q-5…..Q-1-a > Q-1

  • Exported to spreadsheet, and got all the questions in right order.

  • Now another issue occurred, Q-6 (Multiple Line of Text) came first in datasheet, so from view removed it to be displayed or to be exported to spreadsheet.

  • The other issue noticed was when user clicks on “Respond to this survey”, user will get the same reverse orders of questions (i.e. Q-5, 4, 3, 2, 1, 6)

  • Though this helps us to get questions in proper sequence only in Spreadsheet but this cannot be implemented as this occurs disordering of questions in survey.


Found 2 alternate workarounds

Workaround 1


  • Changed all “Rating Scale” questions to “Choice” category with “Radio button” & fill in “mandatory” option

  • Order remained same (i.e. Q- 1, 2, 3, 4, 5, 6)

  • Now it worked proper for both scenarios, user got the right order when open “Respond to this survey” and also got the right order when exported to excel.


Workaround 2


  • Created a page and added a Data View Web part using SPD on the page

  • Used SharePoint survey as a Data source and added all questions / columns in to the web part

  • Then from Data view web part exported data to excel