Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For those searching for a similar answer, the following solution is what I settled on. There is no easy mechanism I could find to interact with a separate DAL and perform the Lucene indexing. </p> <ol> <li>Create the Orchard Module</li> <li>Create new Content Part/Type via aMigration</li> <li>Use Orchard Command infrastructure to import data from your secondary database</li> <li>Use the OnIndexing event in the Content Part handler to allow Lucene to index your datasource.</li> <li>Create a lookup property (I called mine ConcreateProperty) that is populated through a Service I created in the module to interact with the secondary DAL in the OnLoaded event.</li> </ol> <p>My final Handler looked like this: </p> <pre class="lang-cs prettyprint-override"><code>public class HomePartHandler : ContentHandler { public HomePartHandler(IRepository&lt;HomePartRecord&gt; repository, IHomeSearchMLSService homeSearchService) { Filters.Add(StorageFilter.For(repository)); OnLoaded&lt;HomePart&gt;((ctx, part) =&gt; { part.ConcreteProperty = homeSearchService.GetByMlsNumber(part.MlsId) ?? new PropertyDetail(); }); OnIndexing&lt;HomePart&gt;((context, homePart) =&gt; context.DocumentIndex .Add("home_StreetFullName", homePart.Record.StreetFullName).RemoveTags().Analyze().Store() .Add("home_City", homePart.Record.City).RemoveTags().Analyze().Store() .Add("home_State", homePart.Record.State).RemoveTags().Analyze().Store() .Add("home_Zip", homePart.Record.Zip).RemoveTags().Analyze().Store() .Add("home_Subdivision", homePart.Record.Subdivision).RemoveTags().Analyze().Store() .Add("home_Beds", homePart.Record.Beds).RemoveTags().Analyze().Store() .Add("home_Baths", homePart.Record.Baths).RemoveTags().Analyze().Store() .Add("home_SquareFoot", homePart.Record.SquareFoot).RemoveTags().Analyze().Store() .Add("home_PropertyType", homePart.Record.PropertyType).RemoveTags().Analyze().Store() .Add("home_ListPrice", homePart.Record.ListPrice).RemoveTags().Analyze().Store() .Add("home_MlsId", homePart.Record.MlsId).RemoveTags().Analyze().Store() .Add("home_Latitude", (double)homePart.Record.Latitude).RemoveTags().Analyze().Store() .Add("home_Longitude", (double)homePart.Record.Longitude).RemoveTags().Analyze().Store() ); } } </code></pre> <p>This allows me to create a search service for searching through all my data and then hook it up to the model via the Concrete Property, which actually works better from a performance standpoint anyway.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload