Hey Dennis,
i tried implementing that solution but
" BaseIndexProvider externalIndexer = ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"];
"
Line in the example is throwing an exception of "Exception has been thrown by the target of an invocation."
Could you help?
Thanks
I can't really think of a reason why that line specifically would fail, since those classes are a part of the Umbraco Core.
Anyways - what version of Umbraco are you using? My grid package is build against 7.2.0, but it should also work in newer versions of Umbraco. I haven't tested in 7.3.0 though.
Also, if you have created a class similar to the ExamineIndexer class in my Gist (the one Dennis is referencing), could you post that class here? That may help finding the culprit ;)
Hi Anders,
i am using 7.2.0 version of Umbraco , and i am into the very initial stage of implementing your solution so i just have copied your full example
My ExaminIndexer looks like somthing bellow
using Examine;
using Examine.Providers;
using Skybrud.Umbraco.GridData;
using Skybrud.Umbraco.GridData.Values;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using Umbraco.Core.Logging;
namespace Myproject.Web.GridDataIndexer
{
public class ExamineIndexer
{
public ExamineIndexer()
{
BaseIndexProvider externalIndexer = ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"];
externalIndexer.GatheringNodeData += OnExamineGatheringNodeData;
}
private void OnExamineGatheringNodeData(object sender, IndexingNodeDataEventArgs e)
{
try
{
string nodeTypeAlias = e.Fields["nodeTypeAlias"];
LogHelper.Info<ExamineIndexer>("Gathering node data for node #" + e.NodeId + " (type: " + nodeTypeAlias + ")");
if (nodeTypeAlias == "Home" || nodeTypeAlias == "LandingPage" || nodeTypeAlias == "TextPage" || nodeTypeAlias == "BlogPost")
{
string value;
if (e.Fields.TryGetValue("content", out value))
{
LogHelper.Info<ExamineIndexer>("Node has \"content\" value\"");
GridDataModel grid = GridDataModel.Deserialize(e.Fields["content"]);
StringBuilder combined = new StringBuilder();
foreach (GridControl ctrl in grid.GetAllControls())
{
switch (ctrl.Editor.Alias)
{
case "rte":
{
// Get the HTML value
string html = ctrl.GetValue<GridControlRichTextValue>().Value;
// Strip any HTML tags so we only have text
string text = Regex.Replace(html, "<.*?>", "");
// Extra decoding may be necessary
text = HttpUtility.HtmlDecode(text);
// Now append the text
combined.AppendLine(text);
break;
}
case "media":
{
GridControlMediaValue media = ctrl.GetValue<GridControlMediaValue>();
combined.AppendLine(media.Caption);
break;
}
case "headline":
case "quote":
{
combined.AppendLine(ctrl.GetValue<GridControlTextValue>().Value);
break;
}
}
}
e.Fields["content"] = combined.ToString();
}
else
{
LogHelper.Info<ExamineIndexer>("Node has no \"content\" value\"");
}
}
}
catch (Exception ex)
{
LogHelper.Error<ExamineIndexer>("MAYDAY! MAYDAY! MAYDAY!", ex);
}
}
}
}
and this is how my ExaminSetting.config looks like
I dont know why but somehow i am not able to put my ExaminSetting.config file here , so i just want to know is there anything which i need to change in these config files too make it work?
I think I have found the culprit now. The class you just posted seems fine, and it works fine if I copy the class to a local test installation. Also it isn't necessary to edit the config file.
What seems to be the problem is instead where you initialize the class. If you look at my example, the class is initialized during ApplicationStarted.
If I instead change the the Startup to initialize ExamineIndexer during ApplicationStarting, I get the same exception as you (because the examine indexes haven't been loaded at this point).
using Umbraco.Core;
namespace FanoeTest {
public class Startup : ApplicationEventHandler {
private static ExamineIndexer _examineIndexer;
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) {
// Register events for Examine
_examineIndexer = new ExamineIndexer();
}
}
}
Hey Anders,
you saved my life ,You saved me from stabbing my head into wall , thanks a ton , thank you so much for that :) it worked
I have another query - i have grid editor which have complex data stored in it for example
I have an array of key value pair objects and some of these objects are arrays so can i index this kind of complex data with the help of Your solution?
If yes then can your provide me some pointers for that ?
Full Text Search - V7 support
Hi,
Are there plans to make a v7 compatible version of this (fantastic!) package?
Thanks.
Hi Dan
Unfortunately the state of this request is still the same as mentioned here at this stage: https://fulltextsearch.codeplex.com/discussions/483813
Regards,
Rigardt
Great, thanks Rigardt. Looks like it may work with the latest v7; I'll give it a try.
Comment author was deleted
I've had this running on v7 for the last few months (started on 7.0.2 and am now on 7.1.4) and am finding that it works very well.
But does it work for content inside a Grid? 7.2.x EDIT: Yes.
Hi Guys, Does FullTextSearch support grid content search? ,or if you know any other way of doing so? Thanks in advance Yogesh
Hi yogesh,
Perhaps this Github example from Skybrud can help you how to get the grid content searchable.
https://gist.github.com/abjerner/bdd89e0788d274ec5a33
Hope this helps,
/Dennis
Hey Dennis, i tried implementing that solution but
" BaseIndexProvider externalIndexer = ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"]; " Line in the example is throwing an exception of "Exception has been thrown by the target of an invocation." Could you help? Thanks
Hi yogesh,
I can't really think of a reason why that line specifically would fail, since those classes are a part of the Umbraco Core.
Anyways - what version of Umbraco are you using? My grid package is build against 7.2.0, but it should also work in newer versions of Umbraco. I haven't tested in 7.3.0 though.
Also, if you have created a class similar to the
ExamineIndexer
class in my Gist (the one Dennis is referencing), could you post that class here? That may help finding the culprit ;)Hi Anders, i am using 7.2.0 version of Umbraco , and i am into the very initial stage of implementing your solution so i just have copied your full example My ExaminIndexer looks like somthing bellow
using Examine; using Examine.Providers; using Skybrud.Umbraco.GridData; using Skybrud.Umbraco.GridData.Values; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Web; using Umbraco.Core.Logging;
namespace Myproject.Web.GridDataIndexer { public class ExamineIndexer {
} and this is how my ExaminSetting.config looks like
Hope it helps
Thanks
I dont know why but somehow i am not able to put my ExaminSetting.config file here , so i just want to know is there anything which i need to change in these config files too make it work?
I think I have found the culprit now. The class you just posted seems fine, and it works fine if I copy the class to a local test installation. Also it isn't necessary to edit the config file.
What seems to be the problem is instead where you initialize the class. If you look at my example, the class is initialized during
ApplicationStarted
.If I instead change the the
Startup
to initializeExamineIndexer
duringApplicationStarting
, I get the same exception as you (because the examine indexes haven't been loaded at this point).Let me know if this solves your problem ;)
Hey Anders, you saved my life ,You saved me from stabbing my head into wall , thanks a ton , thank you so much for that :) it worked
I have another query - i have grid editor which have complex data stored in it for example I have an array of key value pair objects and some of these objects are arrays so can i index this kind of complex data with the help of Your solution?
If yes then can your provide me some pointers for that ?
thanks in advance
Hi again.
Since this actually is the forum of another package, could you create a new thread here: https://our.umbraco.org/projects/developer-tools/skybrudumbracogriddata/general-discussion/
Then I'd be happy to look into it ;)
Yeah sure :)
Hello,
I am getting an odd problem
Your code just works fine locally. When I install to IIS I get this in the log file:
Like I said works great locally.
the IIS has .net 4.5 enabled
Any ideas?
is working on a reply...