Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kim Thomsen 59 posts 277 karma points
    Sep 17, 2013 @ 14:43
    kim Thomsen
    0

    Examine Search within a url-picker

    Hi how do i search within a url pickers link-title with Examine 
    If i have the following property
    <author>
    <url-picker>
    <new-window>False</new-window>
    <node-id/>
    <url/>
    <link-title>H.C. Andersen</link-title>
    </url-picker>
    </author>
    And if I search for H.C. Andersen i get nothing. This is my code:

    var searchIn = new List<string> { "author", "publisher", "director", "producer", "actors" };
    var query = searchCriteria.GroupedOr(searchIn.ToArray(), "H.C. Andersen").Compile();
    var searchResults = searcher.Search(query).ToList();
  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Sep 17, 2013 @ 16:04
    Ismail Mayat
    101

    Kim,

    You need to implement gatheringnode data event and during indexing inject into the index the values you want to search on. Urlpicker is stored as xml so does not end up in the index and therefore not searchable. See http://thecogworks.co.uk/blog/posts/2012/november/examiness-hints-and-tips-from-the-trenches-part-2/ for more information and some code on how to implement gatheringnode data event. In your code you would need to do something like

    var urlPicker = uComponents.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize(node.GetProperty("author")
    

    That will get you a strongly typed object for the url picker you can then inject to the index the properties.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft