Getting Orchard Indexing & Search working

Topics: Core, General, Troubleshooting, Writing modules
Jan 23, 2013 at 8:10 PM

I'm trying to get the Indexing and Search working on my site. I enabled Lucence, Orchard.Search, and Orchard.Indexing. My Page content item along with several other custom content types are marked as indexable (i see a checkbox if I go to Dashboard->Content->Content Types->(select the content type)-> "Index this content type for search". 

I have hundreds of content items that should be indexed, but for some reason only 122 are indexed when i look in Settings -> Search Index. I am getting some results for one particular content type in the content search, so that at least appears to be working. 

There are no error messages in App_Data\Logs. This is on my local machine, under IIS, windows 7 x64, orchard 1.6. 

Does a content item need to have a field to be indexed? Even so, I have types with Title Part, shouldn't at least the Title Part value be indexed?

Any help would be greatly appreciated.

Jan 24, 2013 at 12:38 AM

I figured out that it was actually indexing (I think), but it was doing so slowly. Orchard loops through every row in the Orchard_Framework_ContentItemVersionRecord table, and only process 50 rows at a time, once per minute. My copy of that table had >10,000 rows, and the content items I happened to be testing with happened to be in the very end of the Id range in that table. 

I temporarily increased it to index 5000 content items per loop, and set up some OnIndexing() handlers in my content part handlers to include properties from my custom Parts in the index. Seems to be working. I also cleared the index and verified that I could speed things up by rapidly clicking the "Update Index" button in the dashboard. Each click moves the loop forward 50 items, and eventually it got there. 

Would it be safe to increase the indexing time to 100 or 200 items per loop in production? Or would it be a bad idea to make that value configurable so I could set it high when I first enable indexing, and then turn it back down to 50 when the initial indexing is done? 

Coordinator
Feb 10, 2013 at 10:31 PM
Try it. I don't think we can guess that.