First of all, I'm not entirely sure this is the right category, this is my first post so please excuse me if I'm not the most experienced forum user here.
Anyway, I'm currently using UmbracoExamine for all project's search needs, and I'm trying to figure out what exactly the query-parameter ".ParentId" does.
I was hoping I could use it to find all child nodes from a parentID, but I can't seem to get it working.
Basically, if the searchstring contains e.g. "C# Programming", it should find all that category's articles. This is just an example.
The only way i have managed to get parent based searches to work is to inject into the index a searchable path. So we have path field it usually looks like -1,1,123,1234. I used gathering node data event and create new field called searchable path so the value in that field looks like -1 1 123 1234 because of the space character the field is tokenised and becomes searchable.
You can then execute queries so if you wanted all children with parent 123 you can do .And("searchablePath","123")
Sorry for getting back to you such a long while after your reply, I ended up simply getting all the results and then filtering them after fetching them, which works fine for this project as it'll have its own server dedicated to hosting it.
Yeah no doubt, but it feels like injecting the searchable path is quite an overkill when I can live with the filtering afterwards. Hopefully they introduce parent-related searching in Umbraco Examine soon. Who knows :)
UmbracoExamine ParentID
Hey there,
First of all, I'm not entirely sure this is the right category, this is my first post so please excuse me if I'm not the most experienced forum user here.
Anyway, I'm currently using UmbracoExamine for all project's search needs, and I'm trying to figure out what exactly the query-parameter ".ParentId" does.
I was hoping I could use it to find all child nodes from a parentID, but I can't seem to get it working.
Basically, if the searchstring contains e.g. "C# Programming", it should find all that category's articles. This is just an example.
Thank you in advance!
Mikkel,
The only way i have managed to get parent based searches to work is to inject into the index a searchable path. So we have path field it usually looks like -1,1,123,1234. I used gathering node data event and create new field called searchable path so the value in that field looks like -1 1 123 1234 because of the space character the field is tokenised and becomes searchable.
You can then execute queries so if you wanted all children with parent 123 you can do .And("searchablePath","123")
Regards
Ismail
Hey Ismail,
Sorry for getting back to you such a long while after your reply, I ended up simply getting all the results and then filtering them after fetching them, which works fine for this project as it'll have its own server dedicated to hosting it.
Thanks for the answer though :)
Mikkel,
Linq in memory filtering when you can filter using lucene causes kittens to die ;-}
Yeah no doubt, but it feels like injecting the searchable path is quite an overkill when I can live with the filtering afterwards. Hopefully they introduce parent-related searching in Umbraco Examine soon. Who knows :)
Mikkel,
On an index you can set parentnode so only items in that folder get indexed just means you have to ensure all your items are in that folder.
Regards
Ismail
is working on a reply...