I have an external application (Contract manager) that has a unique ID for each contract. I have stored the documents for the contracts in a SharePoint RecordCenter library. That unique ID is one of the fields in my RecordCenter library. The unique ID field is not indexed and I already have 400,000 records so I cannot add an index to the field due to the SP throttling limitations. I need to be able to link directly to the documents from my external application, and the only field that can tie the contract record to the SharePoint record is this unique ID.
I have tried:
-using CAML query to filter down to the item I need. problem: I run into the throttling exception.
-using CAML query without a filter to return the throttle limit of items and then loop through them – this works but is extremely slow – like 30 minutes. this isnt acceptable obviously. I need something that takes less than 8 seconds.
Is there something I am missing in my approach?
*Update: I’ve tried using Search, but I am unable to guarantee that the single document I need is returned. Many times there are multiple documents that have metadata with a similar number (my unique ID) in another field. Also, I’m unable to serve up the returned docs automatically – I’m limited to displaying the search results page which isn’t optimal for this application.
*Update: I’ve had to resort to utilizing an external database to store the “Document ID” for each of my items so I can do a fast look up. This has the benefits of direct access to the document from CSOM, but the negative effect of requiring a resource outside of SP to enable the delivery of the documents. Not great, but it’s the best scenario I’ve been able to come up with.
You can extend CSOM to make it simpler to implement with SPServices as its a web service call.
Example:
http://www.itidea.nl/index.php/example-of-using-the-spservices-search-web-service/
Hugh, how do I supply a link directly to the document with CSOM? I dont see Search as part of the 2010 CSOM. Can you direct me to it?
You can supply a link directly to the document with CSOM, if you need any specific data that isn’t available in search you will have to get the crawler to index those properties for you so you can pull them back. “Indexing custom properties in sharepoint 2010” brings back some good results on this. When the link comes back you can use that however you want in your application, even auto launch it in word if you want.
Thanks for the reply Hugh Wood. As I mentioned in an update section above, I’ve tried search via the browser, however it doesn’t meet my needs. Are you saying there is a way to use search with CSOM that would return results to my code where I can then serve up the document directly w/o the user having to see the SharePoint interface?
You should use search for this. To belay your worries if this is 2013 then it will be fine, if it is 2010 you need to add another crawler configuration to do an incremental crawl in the RecordCentre more often. Basically emulating a continuous crawl in 2010. This of course will require some fine tuning but it will work.