views:

139

answers:

2

I have an external system that will send us events in XML. The event will include a link to an Office document and some other metadata.

Now I want Sharepoint to index the document and metadata together. The result I want to achieve is - when a user search hits either metadata or contents of the Office document, I can render a page including both metadata and document summary and display to the user.

Is there a good way to do that? Thanks.

+2  A: 

Will the document be stored outside sharepoint, or when the xml is sent, do you retrieve the document and store it in SharePoint? If the files are always from the same location outside of sharepoint then you could add that as a new content source. The event data could be stored in a list. (store the file as a link)

Then, when the search is performed you could try to do some sort of grouping based on the stored link and the filename in the result. Have a look at the FullTextSqlQuery class. it returns a DataTable which can then be further structured by yourself.

Colin
+1. We do a LOT of this custom search type stuff. Get the datatable of results, modify the datatable, and then display the DataTable in a GridView.
Kit Menke
A: 

You can write your own query to manage the grouping of results yourself.**

An easier way (which may work depending on your requirements) would be to index your result pages only - i.e. the pages where you render the metadata and the summary of the related document. This will only index the document summary though - is that enough? Will users search primarily based on the metadata or the document contents?

You get more control with a customized search solution at the expense of development and testing.

** Looks like Colin beat me to the punch. See his answer for a suggested custom code approach :-)

dariom
Good to see someone agrees with me already, where's my upvote :-P?
Colin