How to search content programmatically ? Options
Kirsten
Posted: Monday, October 06, 2008 4:41:51 PM
Rank: Newbie

Joined: 10/6/2008
Posts: 3
Location: Denmark
Hi,

I would like to perform a search operation on the umbraco content from an external application. My idea is to make a webservice returning ID’s for the documents found.

But how do I programmatically search the published content ??


Kirsten
daniel_l
Posted: Monday, October 06, 2008 5:00:18 PM
Rank: Aficionado

Joined: 6/25/2007
Posts: 146
Location: Malmo, Sweden
Kirsten wrote:
Hi,

I would like to perform a search operation on the umbraco content from an external application. My idea is to make a webservice returning ID’s for the documents found.

But how do I programmatically search the published content ??


Kirsten


Take a look at the XSLT Search package for Umbraco. It is not a web service but a regular search form that searches the umbraco content nodes and returns a list of the nodes matching. I think it should not be to hard to manipulate it to do what you want.

Is it me or umbraco? Umbraco Certified Professional Level 2.
mortenbock
Posted: Monday, October 06, 2008 7:20:27 PM

Rank: Addict

Joined: 7/19/2006
Posts: 815
Location: Århus, Denmark
Depending on the volume of content on your site, you might also want to look into using the Lucene search that is included in Umbraco. I have not used it myself, but I know there have been various extensions to the existing functions.

XSLT search will work well up to around 1000 nodes, depending on the number of properties you need to search through.

Morten Bock - Level 2 certified - MVP 2008/2009 - My danish blog with a few english posts

Kirsten
Posted: Tuesday, October 07, 2008 1:34:44 PM
Rank: Newbie

Joined: 10/6/2008
Posts: 3
Location: Denmark
Thanks for the answers, Daniel and Morten.

I have been looking at both solution but can't find the properly solution.

The xslt solution are intended to be used in a macro in a template to render the result.
I guess that what I have to do is to import the umbraco.config file into a XPathDocument,
programmatically give the parameter currentPage a value and
then transform the xml with xslt to get the ID's of the selected documents ??


The Lucene Search solution would be a good solution but I can't find any documentation on how to implement it in the code.
I have been looking at the umbraco.cms.businesslogic.index namespace, but it seems to search in the content part in the administration console -
that means both published and unpublished content and without the words from the templates.

Any suggestions ??
daniel_l
Posted: Tuesday, October 07, 2008 2:04:17 PM
Rank: Aficionado

Joined: 6/25/2007
Posts: 146
Location: Malmo, Sweden
Kirsten wrote:
The xslt solution are intended to be used in a macro in a template to render the result.
I guess that what I have to do is to import the umbraco.config file into a XPathDocument,
programmatically give the parameter currentPage a value and
then transform the xml with xslt to get the ID's of the selected documents ??


I was thinking you could include the XSLT macro in a blank template. Then modify the XSLT macro to output XML or JSON or whatever format you want.

Use the template on a otherwise empty content node. Call this content node from your external app with the search phrase as a querystring. Parse the text retrieved.

Is it me or umbraco? Umbraco Certified Professional Level 2.
mortenbock
Posted: Wednesday, October 08, 2008 5:56:23 PM

Rank: Addict

Joined: 7/19/2006
Posts: 815
Location: Århus, Denmark
Kirsten wrote:

I have been looking at the umbraco.cms.businesslogic.index namespace, but it seems to search in the content part in the administration console -
that means both published and unpublished content and without the words from the templates.


None of the options will search the template contents. Only node contents are searched. If you want crawler search, you need to look a some other solution. Maybe this:

http://kenny.no/archive/2008/9/25/microsoft-search-server-express-2008-and-umbraco.aspx

Morten Bock - Level 2 certified - MVP 2008/2009 - My danish blog with a few english posts

imayat12
Posted: Thursday, October 09, 2008 10:25:29 AM

Rank: Addict

Joined: 7/19/2006
Posts: 670
Location: Preston, UK
you could also try the following lucene crawlers

http://www.bitethebullet.co.uk/LuceneNetSpider/tabid/78/Default.aspx

http://sourceforge.net/projects/seekafile/

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
Kirsten
Posted: Friday, October 10, 2008 12:34:17 PM
Rank: Newbie

Joined: 10/6/2008
Posts: 3
Location: Denmark
Thanks for the responses.
I now have information to move forward !
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.