Hi! Does Umbraco use Lucene under the hood in some way? I use xslt search on my sites and havent done any reading about Lucene yet, and frankly I do not understand what it does other than it's indexing everything. And since the indexing part gives me some errors from time to time, and the number of files it's producing is huge I wonder if I can disable or even uninstall it?
I was also getting loads and loads of errors on this at some point. As it turns out, I had written some event handlers that performed really poorly and did things in a very inefficient way.
I refactored the event handlers, most notably, I stopped using "document.XmlGenerate" after updating a document, instead, I now use "library.UpdateDocumentCache(document.Id)", which I should've done in the first place.
Finally, after the refactoring, I ran: http://the.site/umbraco/reindex.aspx to regenerate the Lucene index (depending on the number of nodes in your site, this might take a while).
I am currently investigating problems I'm having with the Lucene indexer, it might not be completely thread safe. For the time being, I've even disabled indexing for some most of the nodes, with an event handler that cancels the indexing event:
namespace EventHandlers
{
public class CancelLuceneIndexer : ApplicationBase
{
public CancelLuceneIndexer()
{
Document.BeforeAddToIndex += CancelIndexer;
}
Are you able to expand more on how you disabled indexing? Is this in the Umbraco source rather than a website solution? I can't see an EventHandlers namespace...
I tested this on my staging server and it worked fine.
So I tried it on live and I get an error ???
Could not load file or assembly 'Lucene.Net, Version=2.0.0.4, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Can I uninstall Lucene? Do I need it?
Hi! Does Umbraco use Lucene under the hood in some way? I use xslt search on my sites and havent done any reading about Lucene yet, and frankly I do not understand what it does other than it's indexing everything. And since the indexing part gives me some errors from time to time, and the number of files it's producing is huge I wonder if I can disable or even uninstall it?
Hi Jonas,
I think it is used for the search within Umbraco UI on the top left corner, so if you removed Lucene the search will fail.
Cheers,
Chris
I think Chris is correct, it is used internally by Umbraco for searching.
Hi,
You might find this related page on the Wiki an interesting read:
http://umbraco.org/documentation/books/codegarden-2008/advanced-lucene-search
Cheers,
Chris
Ah, thanks. I let it be there then... And I wait for 4.1 and "Examine"
I was also getting loads and loads of errors on this at some point. As it turns out, I had written some event handlers that performed really poorly and did things in a very inefficient way.
I refactored the event handlers, most notably, I stopped using "document.XmlGenerate" after updating a document, instead, I now use "library.UpdateDocumentCache(document.Id)", which I should've done in the first place.
Finally, after the refactoring, I ran: http://the.site/umbraco/reindex.aspx to regenerate the Lucene index (depending on the number of nodes in your site, this might take a while).
I've been free of Lucene errors ever since!
Ah, thanks Sebastian, doing that myself now, takes some time as you said, 5 minutes 25% done.
I am currently investigating problems I'm having with the Lucene indexer, it might not be completely thread safe. For the time being, I've even disabled indexing for some most of the nodes, with an event handler that cancels the indexing event:
namespace EventHandlers {
public class CancelLuceneIndexer : ApplicationBase
{
public CancelLuceneIndexer()
{
Document.BeforeAddToIndex += CancelIndexer;
}
private static void CancelIndexer(Document sender, AddToIndexEventArgs e)
{
if(sender.ContentType.Alias == "HotSpot") e.Cancel = true;
}
}
}
Are you able to expand more on how you disabled indexing? Is this in the Umbraco source rather than a website solution? I can't see an EventHandlers namespace...
If I cannot resolve my issue here http://our.umbraco.org/forum/getting-started/installing-umbraco/6594-No-sub-file-with-id-_kpkf6-found I will need to look at doing something like this as my client can't publish at the moment and it is becoming a huge issue.
Quoting @Shazwazza: "an easy way to disable lucene indexing in 4.0.x is just delete the lucene dll... no errors are thrown & no indexes made."
See if that can help (But of course, this means you can't search for documents in the backend...)
Cheers,
/Dirk
I tested this on my staging server and it worked fine.
So I tried it on live and I get an error ???
Could not load file or assembly 'Lucene.Net, Version=2.0.0.4, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
What on earth is going on?!
if you use Umbraco with Lucene/Examine in a loadbalanced environment, you might have to check this thread
https://examine.codeplex.com/discussions/270941
is working on a reply...