Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Apr 30, 2010 @ 11:43
    Ismail Mayat
    0

    Examine search question

    Slace or Shawwaza,

    The old umbSearch used to index all specified properties but also used to do a separate field called content that was a combination of all those properties.  So for example if you wanted to serach for the word umbraco in all your fields you could just search on content field in index.  Looking at the index created by examine you dont have this combined field so am i right in assuming i would need to do something like 

    searchCriteria
      .Field("headerText", "umbraco")
      .Or()
      .Field("bodyText", "umbraco")

    and so forth for all the fields?  

    Ps great work guys examine totally rocks!

    Regards

    Ismail

  • Aaron Powell 1708 posts 3044 karma points c-trib
    May 03, 2010 @ 01:13
    Aaron Powell
    0

    Yeah we don't combine the data into a single field, you can use the GatheringNodeData or DocumentWriting event (depending on whether you want to just add a combined field to the collection or you want complete control over how it's handed within Lucene itself).

    I'd recommend GatheringNodeData as the event, then you just need to loop through the fields in the event arg, get the content and add it to your own field.

  • Shannon Deminick 1510 posts 5195 karma points hq
    May 03, 2010 @ 12:16
    Shannon Deminick
    0

    Actually, up until we built the fluent API, examine had this functionality built in... The first overload for searching that doesn't use the Fluent API should actually search all non-system fields.

    I don't think it would be too difficult to add another extension method to the Fluent API to have .AllFields() or something..?

  • Aaron Powell 1708 posts 3044 karma points c-trib
    May 03, 2010 @ 12:24
    Aaron Powell
    0

    Yeah you can use the non-fluent API method, it iterates over all the fields defined in the config, it wont handle any custom fields you've inserts yourself.

    I'd still go with having a separate field cuz then you can have only some of the fields, not all, as for free text searching you may want to exclude things like NodeTypeAlias.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies