Getting search to work -- Here's how to do it Options
jHodgkinson
Posted: Friday, May 30, 2008 4:46:33 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
Pete - I have to run out for an hour or so. I'll be back in a bit just in case the above suggestion does not work... Hang in there, we'll get this up and running... we're close...
pkoutoul
Posted: Friday, May 30, 2008 5:04:54 PM

Rank: Fanatic

Joined: 8/9/2007
Posts: 284
Location: Kentucky, USA
I think we were posting at the same time.

Tried the second suggestion and lo and behold, it worked! Thank you so much for your patient assistance. I really don't like the fact that my users will have put a file extension on the end of the documents, but I guess I can live with that for now.

Thanks again John!

Pete Koutoulas • Fayette County Public Schools • Lexington, Kentucky
jHodgkinson
Posted: Friday, May 30, 2008 7:06:32 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
Pete - I should be able to do that - just give me a few minutes...
jHodgkinson
Posted: Friday, May 30, 2008 7:39:57 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
Pete - I went ahead and modified the assembly per your request. you can download the updated umbSearch.dll at:

http://www.ncbar.org/download/snaps/umbSearch.zip

Keep in mind this will index ALL valid file extensions in your media folders by default. By chance if you ever need to exclude certain files (say you want specific files to be hidden or not returned in search results) you should be able to either exclude the node by manually adding the node to the "excludeIds" property in the umbracoSearchConfig.xml file or you can easily add a "excludeFileFromSearch" aliased True/false property to your "File" data type and then go in and set which files you want excluded from the index (not adding the property will not affect indexeding of files).






pkoutoul
Posted: Friday, May 30, 2008 8:07:27 PM

Rank: Fanatic

Joined: 8/9/2007
Posts: 284
Location: Kentucky, USA
Dude! You rock! I can't tell you how much I appreciate your taking the time to do all this. The updated dll works exactly the way I need it to.

I agree with Neils -- you need to submit this to the package team. Hopefully the next newbie that comes along with be able to get his umbraco search going in less time than it took me.

Have a great weekend, John.

Pete Koutoulas • Fayette County Public Schools • Lexington, Kentucky
jHodgkinson
Posted: Friday, May 30, 2008 8:21:46 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
cool, sounds good Pete! let me know if you run into any other issues. also, in case you want to make a "quick search" per say to include on other pages, you can pass a "search" param key/pair value through the querystring to display search results as well (i.e. search.aspx?search=media). I should have a macro for this too if you like...

Niels et al did most of the work on the umbracoExt project - I just tweaked it a little here and there. I'll try to wrap everything up together next week and send it in to the repo group if others can benefit. I thought I remembered reading somewhere that Ismail was releasing some new type of search at CodeGarden though. Either way, I'll send something in to the group...
jHodgkinson
Posted: Friday, May 30, 2008 9:24:06 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
Pete - also forgot to mention, you can exclude content nodes by manually adding the node to the "excludeIds" property in the umbracoSearchConfig.xml file or you can also use the umbracoNaviHide property in your content data types.
hartvig
Posted: Saturday, May 31, 2008 12:06:18 AM

Rank: Addict

Joined: 3/17/2008
Posts: 952
Location: Nyborg, Denmark
Only referenced media files is indexed as far as I recall. So only if you have a media file that's being referenced from a document using a media picker AND the alias of that file matches the alias in the config file. But it's been more than a year (two?) since I last coded the thing, so I can't really recall :-O

Jeeeez, did I really start this :-)
dannyboy wallis
Posted: Monday, June 02, 2008 1:15:27 PM
Rank: Enthusiast

Joined: 3/13/2008
Posts: 16
Great thread - this is going to come in very handy for me very soon. Thanks all.
jHodgkinson
Posted: Monday, June 02, 2008 2:39:59 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
hartvig wrote:
Only referenced media files is indexed as far as I recall. So only if you have a media file that's being referenced from a document using a media picker AND the alias of that file matches the alias in the config file. But it's been more than a year (two?) since I last coded the thing, so I can't really recall :-O


Niels, that sounds right (awesome job BTW). We required the need to be able to index media items that may or not be included or linked up through document types that use the media picker. Although, that would be ideal in most situations we have some situations where it may not apply.
pkoutoul
Posted: Tuesday, June 03, 2008 7:21:25 PM

Rank: Fanatic

Joined: 8/9/2007
Posts: 284
Location: Kentucky, USA
John, I have run into a problem...

I was trying to use a custom XSLT file to display the results, but it doesn't seem to recognize the XsltLayout property. Digging a little deeper, I noticed that the XsltLayout property in your macro is not a text data type but a content tree type. So I re-inserted the macro and tried to select the XSLT file, but then I realized that the content picker only allows access to (what else?) content tree data, not developer nodes. So then I tried changing the data type to text but that didn't seem to work either. Then I think I hit upon the real problem.

I deleted the macro and re-created it. After adding the user control and browsing the properties, it turns out that the XsltLayout property is not exposed by the user control. (Neither is DebugMode, by the way.)

So I'm thinking hopefully you just forgot to write a property routine for XsltLayout? Would you mind taking a look?



Pete Koutoulas • Fayette County Public Schools • Lexington, Kentucky
jHodgkinson
Posted: Tuesday, June 03, 2008 9:03:07 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
Pete - sorry about that... I had forgotten I had removed some of the functionality out of my variation (been a while since I've looked at the code). I've added the debug and xslt capabilities back. Be sure to change the XsltLayout property to a text type in the macro properties - if a filename value is provided it should look inside the /xslt/ folder for this file (i.e. umbSearchOrderedList.xslt).

Below is the zipped up files (umbSearch.dll, umbSearchControl.ascx and a sample umbSearchOrderedList.xslt file). note, I've never tested the .xslt variation though...

Please let me know if issues exist or if you run into any further problems...

http://www.ncbar.org/download/snaps/umbSearch_06032008.zip
CAS
Posted: Wednesday, June 04, 2008 2:31:11 PM
Rank: Newbie

Joined: 6/4/2008
Posts: 1
Location: Flensburg, Germany
Quote:
you can setup a web-serviceable version that performs indexes at scheduled intervals if you like so you don't have to do this manually but that's another story/post...


How would one go about that?

Excellent thread by the way!
jHodgkinson
Posted: Wednesday, June 04, 2008 3:07:57 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
There are probably lots of different ways to accomplish this - this is the route I took.

I wrote a SQL Server Integration Services (SSIS) package (dtsx) that has the ability to make web serviceable calls (or http requests) and can be invoke from inside a SQL Server 2005 job. That job then can be schedule to be executed at whatever intervals are needed (hourly, daily, weekly, monthly, etc). This package runs on SQL and is outside of the web application scope. In this instance it only requires the actual web-service to be up and running to be invokable (and of course the proper credentials for invoking the service)... this single DTS package could be used to invoke a myriad of services called from within multiple SQL jobs...











pkoutoul
Posted: Wednesday, June 04, 2008 4:40:28 PM

Rank: Fanatic

Joined: 8/9/2007
Posts: 284
Location: Kentucky, USA
John -- once again I need help. (I'll bet you're sorry you ever replied to my post, huh?).

After I installed your updated files, it still does not want to use my XSLT file to format the results. I have tried several different XSLT variations, and no matter what I do it seems to ignore the file. I tried deleting and re-creating the macro, giving it a different name, etc.

Any ideas? It is picking up the debug mode property now. Also, it must be picking up the XsltLayout property because if I give it an invalid name it throws an exception. So it is finding the file, it just isn't parsing it to display the results.

Any ideas? If you don't want to fool with this any more, maybe you could make the source available. I might be able to poke around and figure it out. Thanks.

Pete Koutoulas • Fayette County Public Schools • Lexington, Kentucky
jHodgkinson
Posted: Wednesday, June 04, 2008 6:10:19 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
Pete - as I stated earlier I had not fully implemented the xslt variation so it took me a few minutes to write up the needed logic for the media files implementation.

I added properties for resultTitle, resultUrl, resultScore, resultDate and resultWriter - these are basic values populated regardless of content or media item and should be exposed to the xslt layer (see updated xslt file in zip below). anyways, give these new updates a try and let me know how it works (umbSearch.dll and umbSearchOrderedList.xslt):

http://www.ncbar.org/download/snaps/umbSearch_06042008.zip


pkoutoul
Posted: Wednesday, June 04, 2008 7:10:56 PM

Rank: Fanatic

Joined: 8/9/2007
Posts: 284
Location: Kentucky, USA
At long last, I believe we have achieved success! It seems to be working great now. Thanks so much, John.

If you're ever in Kentucky, I'll have to buy you dinner. :-)


Pete Koutoulas • Fayette County Public Schools • Lexington, Kentucky
jHodgkinson
Posted: Wednesday, June 04, 2008 8:07:33 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
WOOHOO! sounds good... please let me know if anything else comes up or if there are any additional features that might make this better...

I'll throw another snapshot in there as well...

jHodgkinson
Posted: Thursday, June 05, 2008 3:41:17 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
below is an updated package file with all the previously mentioned updates (I believe so anyways, minus the SQL DTS stuff):

http://www.ncbar.org/download/snaps/umbracoExtSearch_1.02.umb.zip
ovalsquare
Posted: Monday, June 09, 2008 11:02:16 PM
Rank: Enthusiast

Joined: 6/23/2007
Posts: 12
This is an excellent post (and quite incredible help provided from beginning to end). Is the source going to ever be made available to the community?
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.