Copied to clipboard

Flag this post as spam?

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


  • Brian 77 posts 251 karma points
    Dec 17, 2014 @ 14:06
    Brian
    0

    Examine search not working

    Hi guys,

    Setting up a new search tool in an estate agents website and struggling to get it working.  I've used Examine to set the tool up, well actually I have used a search tool from another site I have developed and in that instance a developer built the search tool for me (alas he is no longer available to contact).

    I will say that I am an examine newby and this is first attempt at playing with it at all, so please don't assume I have done all of the basics!

    I have checked the Examine Management section and all appears ok there except for 'Index info & Tools' section where 0 records are showing, although in the 'provider properties' section I can see 1 record in there (which is correct)

    These are the files I have set up so far:

     

    This is in the examineIndex

    <IndexSet SetName="PropertySearch" IndexPath="~/App_Data/ExamineIndexes/PropertySearch/">

        <IndexAttributeFields>

          <add Name="id" />

          <add Name="nodeName"/>

          <add Name="updateDate" />

          <add Name="writerName" />

          <add Name="nodeTypeAlias" />

        </IndexAttributeFields>

        <IndexUserFields>

          <add Name="rent" Type="Number"/>

          <add Name="propertyRoadAndAddress"/>

          <add Name="town"/>

          <add Name="postCode"/>

          <add Name="propertyType"/>

          <add Name="numberOfBedrooms" Type="Number"/>

          <add Name="fullPropertyDetails"/>

          <add Name="councilTaxBand"/>

        </IndexUserFields>

        <IncludeNodeTypes>

          <add Name="PropertyDetails" />

        </IncludeNodeTypes>

     

    and this is from my examineSettings:

    <add name="PropertySearchIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"

          supportUnpublished="false"

          supportProtected="true"

          interval="10"

          analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"

          indexSet="PropertySearch"/>

     

    This is the search section itself:

    <!--search starts here-->

    @{

                    System.Xml.XPath.XPathNodeIterator iterator = umbraco.library.GetPreValues(1306);

                    iterator.MoveNext();

                    System.Xml.XPath.XPathNodeIterator preValues = iterator.Current.SelectChildren("preValue", "");

     

                    <form action="/rent-and-property-search/" method="get">

                        <input type="hidden" name="category" value="PropertyDetails" />

                        <ul>

    <li>

    <p class="searchboxlet">

                            <label>Location</label><br><br>

                            <input type="text" value="town" id="Town" name="town" />

     

                            <br><br><label>OR Postcode</label><br><br>

                            <select name="postcode" id="postcode">

                                <option value="">Show all</option>

                                @while (preValues.MoveNext())

                                {

                                    string preValue = preValues.Current.Value;

                                    <option>@preValue</option>

                                }

                            </select>

                        </p>

    </li>

    <li>

                       <p class="searchboxlet">

                            <label>Type of Property</label><br><br>

                            <select id="propertyType" name="propertyType">

                                <option value="">Show all</option>

                                <option>Detached</option>

                                <option>Semi-Detached</option>

                                <option>Terraced</option>

                                <option>Bungalow</option>

                                <option>Flat / Apartment</option>

                            </select>

                        </p>

    </li>

    <li>  

                        <p class="searchboxlet">

                            <label>Rent</label><br><br>

                            <select id="priceMin" name="priceMin">

                                <option value="0" selected="selected">No min</option>

                                <option value="100">100 PCM</option>

                                <option value="150">150 PCM</option>

                                <option value="200">200 PCM</option>

                                <option value="250">250 PCM</option>

                                <option value="300">300 PCM</option>

                                <option value="350">350 PCM</option>

                                <option value="400">400 PCM</option>

                                <option value="450">450 PCM</option>

                                <option value="500">500 PCM</option>

                                <option value="600">600 PCM</option>

                                <option value="700">700 PCM</option>      

                            </select>

                           <br><br> <label>To</label><br><br>

                            <select id="priceMax" name="priceMax">

                                <option value="100000" selected="selected">No max</option>

                                <option value="100">100 PCM</option>

                                <option value="150">150 PCM</option>

                                <option value="200">200 PCM</option>

                                <option value="250">250 PCM</option>

                                <option value="300">300 PCM</option>

                                <option value="350">350 PCM</option>

                                <option value="400">400 PCM</option>

                                <option value="450">450 PCM</option>

                                <option value="500">500 PCM</option>

                                <option value="600">600 PCM</option>

                                <option value="700">700 PCM</option>

    <option value="80000">800+ PCM</option>

                            </select>

                        </p>

    </li>

    <li>

                        <p class="searchboxlet">

                            <label>No. of Bedrooms</label><br><br>

                            <select id="roomsMin" name="roomsMin">

                                <option value="0">No min</option>

                                <option value="1">1</option>

                                <option value="2">2</option>

                                <option value="3">3</option>

                                <option value="4">4</option>

                                <option value="5">5</option>

                            </select>

                           <br><br> <label>To</label><br><br>

                            <select id="roomsMax" name="roomsMax">

     

    And this is the results section:

     

     

     <section id="resultsview">

            @{

                try

                {

                    if (!string.IsNullOrEmpty(Request.QueryString["category"]))

                    {

     

                        var catogory =  Request.QueryString["category"];

                        var town = Request.QueryString["town"];

                        var postcode = Request.QueryString["postcode"];

                        var propertyType = Request.QueryString["propertyType"];

     

                        int roomsMin = Int32.Parse(Request.QueryString["roomsMin"]);

                        int roomsMax = Int32.Parse(Request.QueryString["roomsMax"]);

                        int priceMin = Int32.Parse(Request.QueryString["priceMin"]);

                        int priceMax = Int32.Parse(Request.QueryString["priceMax"]);

     

                        //Pull out  the property index set that we defined in the examine config

                        var Searcher = Examine.ExamineManager.Instance.SearchProviderCollection["PropertySearcher"];

     

                        //Setup search criteria

                        var searchCriteria = Searcher.CreateSearchCriteria(Examine.SearchCriteria.BooleanOperation.Or);

     

                        //build the query

                        var query = searchCriteria.Field("propertyType", propertyType);

                        if (propertyType != string.Empty) { query.And().Field("propertyType", propertyType); }

                        if (town != string.Empty) { query.And().Field("town", town); }

                        if (priceMin != null && priceMax != null) { query.And().Range("rent", priceMin, priceMax, true, true); }

                        if (roomsMin != null && roomsMax != null) { query.And().Range("numberOfBedrooms", roomsMin, roomsMax, true, true); }

                        query.And().Field("nodeTypeAlias", catogory);

     

                        //Execute the query and populate the dataset

                        var results = Searcher.Search(query.Compile());

     

                        //paging starts here

                        int currentPage = 1;

                        if (Request.QueryString["page"] != null)

                        {

                            currentPage = Int32.Parse(Request.QueryString["page"]);

                        }

     

                        //TOTAL ITEMS TO DISPLAY PER PAGE

                        int itemsPerPage = 6;

                        int totalItems = results.Count();

                        int totalPages = (int)Math.Ceiling((double)totalItems / (double)itemsPerPage);

     

                        if (currentPage > totalPages) { currentPage = totalPages; }

                        else if (currentPage < 1) { currentPage = 1; }

     

                        if (results.Count() > 0)

                        {

                            <h2>@results.Count() Properties found - Please find your Results Below</h2>

                            <ul>

                                @foreach (var x in results.Skip((currentPage - 1) * itemsPerPage).Take(itemsPerPage))

                                {

                                    var thisNode = Umbraco.TypedContent(x.Id);

                                    <li>

                                        @if (@thisNode.GetProperty("featuredImage").Value != null)

                                        {

                                            <figure><a href="@umbraco.library.NiceUrl(x.Id)"><img src="@thisNode.GetProperty("featuredImage").Value"></a></figure>

                                        }

                                        <div class="resultstext">

                                            <h3 class="red">£@x.Fields["rent"] PCM</h3>

                                            <h4>@x.Fields["nodeName"]</h4>

                                           @Umbraco.Truncate(x.Fields["fullPropertyDetails"], 125)

                                           <br/><br/>

                                            <a href="@umbraco.library.NiceUrl(x.Id)" class="viewletprop">View Property Details</a>

                                        </div>

                                    </li>

                                }

                            </ul>

     

                            if (totalPages > 1)

                            {

                                <p>

                                    Page @currentPage of @totalPages

                                </p>

                <div id="resultspaging">

                                <ul class="paging">

                                    @for (int p = 1; p < totalPages + 1; p++)

                                    {

                                        string selected = (p == currentPage) ? "selected" : String.Empty;

                                        string url = "?page=" + p;

                                        if (catogory != null) { url += "&category=" + catogory; }

                                        if (town != null) { url += "&town=" + location; }

                                        if (postcode != null) { url += "&postcode=" + postcode; }

                                        if (propertyType != null) { url += "&propertyType=" + propertyType; }

                                        if (roomsMin != null) { url += "&roomsMin=" + roomsMin; }

                                        if (roomsMax != null) { url += "&roomsMax=" + roomsMax; }

                                        if (priceMin != null) { url += "&priceMin=" + priceMin; }

                                        if (priceMax != null) { url += "&priceMax=" + priceMax; }

                                        <li class="@selected"><a href="@url" title="Go to page @p of results">@p</a></li>

                                    }

                                </ul>

    </div>

                            }

                        }

                        else

                        {

                            <h3>Sorry, no results found</h3>

                            <p><a href="/residential-lettings/" class="searchagain"> Try searching again</a></p>

                        }

                    }

                }

     

                //Catch and display any errors. Maybe comment this before going live.

                catch (Exception ex)

                {

                    <p>@ex.ToString()</p>

                }

            }

     

        </section><!--resultsview-->

                                <option value="20">No max</option>

                                <option value="1">1</option>

                                <option value="2">2</option>

                                <option value="3">3</option>

                                <option value="4">4</option>

                                <option value="5">5</option>

                                <option value="20">6+</option>

                            </select>

                        </p>

    </li>

    <li>

                        <input type="submit" value="SHOW RESULTS" id="search5" />

    </li>

                    </form>

                }

    <!--search ends here-->

     

     

    Any and all help appreciated peeps.

  • Sören Deger 733 posts 2844 karma points c-trib
    Dec 17, 2014 @ 14:38
    Sören Deger
    0

    Hi Brian,

    in ExamineSettings.config:

    It seems if you have only set your Indexer in ExamineIndexProviders . But you must also insert the Searcher, in ExamineSearchProviders like this:

     <add name="PropertySearchSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
          analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcard="true"/>

     

    And rename your IndexSet in ExamineIndex.config from PropertySearch to PropertySearchIndexSet. The naming conventions are important!

     

    Best regards

    Sören
     

  • Sören Deger 733 posts 2844 karma points c-trib
    Dec 17, 2014 @ 14:40
    Sören Deger
    0

    The search section and result section are non-essential at this time. If you have 0 records in your Index then it is most likely a configuration issue.


    Sören

  • Brian 77 posts 251 karma points
    Dec 19, 2014 @ 12:47
    Brian
    0

    Hi Soren,

    Thanks for the information, must admit that most of the reasoning behind this is not making sense to me at the moment, hence the floundering!

    I have amended my ExamineSettings file as recommended but this causing my whole site to crash, am I missing something?

    Also, when you say that something is wrong with my configuration where abouts should I be looking?

     

    This is the code I now have for my ExamineSettings file:

     

    <?xml version="1.0"?>

    <!-- 

    Umbraco examine is an extensible indexer and search engine.

    This configuration file can be extended to add your own search/index providers.

    Index sets can be defined in the ExamineIndex.config if you're using the standard provider model.

     

    More information and documentation can be found on CodePlex: http://umbracoexamine.codeplex.com

    -->

    <Examine>

      <ExamineIndexProviders>

        <providers>

          <add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"

               supportUnpublished="true"

               supportProtected="true"

               analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>

     

          <add name="InternalMemberIndexer" type="UmbracoExamine.UmbracoMemberIndexer, UmbracoExamine"

               supportUnpublished="true"

               supportProtected="true"

               analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>

     

            <!-- default external indexer, which excludes protected and unpublished pages-->

            <add name="ExternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"/>

     

    <add name="PropertySearchIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"

          supportUnpublished="false"

          supportProtected="true"

          interval="10"

          analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"

          indexSet="PropertySearch"/>

     

     

    <add name="PropertySearchSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcard="true"/>

     

     

          

        </providers>

      </ExamineIndexProviders>

     

      <ExamineSearchProviders defaultProvider="ExternalSearcher">

        <providers>

          <add name="InternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"

               analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>

            

          <add name="ExternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" />

          

          <add name="InternalMemberSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"

               analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcards="true"/>

     

          <add name="PropertySearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"

           analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" indexSet="PropertySearch" enableLeadingWildcards="true"/>

     

        </providers>

      </ExamineSearchProviders>

     

    </Examine>

     

  • Brian 77 posts 251 karma points
    Jan 02, 2015 @ 12:36
    Brian
    0

    Hi Soren,

    Slowly getting somewhere..

    I removed the following from my Examineindex.config file and I now have 29 nodes found:

    <IncludeNodeTypes>

          <add Name="PropertyDetails" />

        </IncludeNodeTypes>

    So looks like I was somehow referencing an incorrect doc type although that is exctly what it was called (any ideas on why, assuming it's important to the solution)

     

    When I now run a search on the site I now get the following error on the results page:

    System.ArgumentNullException: Value cannot be null. Parameter name: s at System.IO.StringReader..ctor(String s) at Lucene.Net.QueryParsers.QueryParser.GetFieldQuery(String field, String queryText) at Lucene.Net.QueryParsers.MultiFieldQueryParser.GetFieldQuery(String field, String queryText, Int32 slop) at Examine.LuceneEngine.SearchCriteria.LuceneSearchCriteria.GetFieldInternalQuery(String fieldName, IExamineValue fieldValue, Boolean useQueryParser) at Examine.LuceneEngine.SearchCriteria.LuceneSearchCriteria.FieldInternal(String fieldName, IExamineValue fieldValue, Occur occurance, Boolean useQueryParser) at Examine.LuceneEngine.SearchCriteria.LuceneSearchCriteria.FieldInternal(String fieldName, IExamineValue fieldValue, Occur occurance) at ASP._Page_Views_PropertySearch_cshtml.Execute() in c:\HostingSpaces\bmhwebdesign\letitbeproperties.com\wwwroot\Views\PropertySearch.cshtml:line 53

    And just for reference this is where I have set files up (again I am a total nooby at this so may well have missed out something vital!!)

    1. set up initial search code (see below)

    2. set up results query code (see below)

    3+4 amended examinindex config and examine settings config to include the new search tool (see below for each)...  

    Have I missed any important steps out for setting up an examine based search tool?

     

    Code currently in place:

     

    Initial Search Code:

    <!--search starts here-->

     

    @{

                    System.Xml.XPath.XPathNodeIterator iterator = umbraco.library.GetPreValues(1093);

                    iterator.MoveNext();

                    System.Xml.XPath.XPathNodeIterator preValues = iterator.Current.SelectChildren("preValue", "");


                    <form action="/rent-and-property-search/" method="get">

                        <input type="hidden" name="category" value="PropertyDetails" />

                        <ul>

    <li>

    <p class="searchboxlet">

                            <label>Town</label><br><br>

                            <input type="text" value="Town" id="town" name="town" />


                            <br><br><label>OR Postcode</label><br><br>

                            <select name="postcode" id="postcode">

                                <option value="">Show all</option>

                                @while (preValues.MoveNext())

                                {

                                    string preValue = preValues.Current.Value;

                                    <option>@preValue</option>

                                }

                            </select>

                        </p>

    </li>

    <li>

                       <p class="searchboxlet">

                            <label>Type of Property</label><br><br>

                            <select id="propertyType" name="propertyType">

                                <option value="">Show all</option>

                                <option>Detached</option>

                                <option>Semi-Detached</option>

                                <option>Terraced</option>

                                <option>Bungalow</option>

                                <option>Flat / Apartment</option>

                            </select>

                        </p>

    </li>

    <li>  

                        <p class="searchboxlet">

                            <label>Rent</label><br><br>

                            <select id="priceMin" name="priceMin">

                                <option value="0" selected="selected">No min</option>

                                <option value="100">100 PCM</option>

                                <option value="150">150 PCM</option>

                                <option value="200">200 PCM</option>

                                <option value="250">250 PCM</option>

                                <option value="300">300 PCM</option>

                                <option value="350">350 PCM</option>

                                <option value="400">400 PCM</option>

                                <option value="450">450 PCM</option>

                                <option value="500">500 PCM</option>

                                <option value="600">600 PCM</option>

                                <option value="700">700 PCM</option>      

                            </select>

     

                           <br><br> <label>To</label><br><br>


                            <select id="priceMax" name="priceMax">

                                <option value="100000" selected="selected">No max</option>

                                <option value="100">100 PCM</option>

                                <option value="150">150 PCM</option>

                                <option value="200">200 PCM</option>

                                <option value="250">250 PCM</option>

                                <option value="300">300 PCM</option>

                                <option value="350">350 PCM</option>

                                <option value="400">400 PCM</option>

                                <option value="450">450 PCM</option>

                                <option value="500">500 PCM</option>

                                <option value="600">600 PCM</option>

                                <option value="700">700 PCM</option>

    <option value="80000">800+ PCM</option>

                            </select>

                        </p>

    </li>

    <li>

                        <p class="searchboxlet">

                            <label>No. of Bedrooms</label><br><br>

                            <select id="roomsMin" name="roomsMin">

                                <option value="0">No min</option>

                                <option value="1">1</option>

                                <option value="2">2</option>

                                <option value="3">3</option>

                                <option value="4">4</option>

                                <option value="5">5</option>

                            </select>


                           <br><br> <label>To</label><br><br>

                            <select id="roomsMax" name="roomsMax">

                                <option value="20">No max</option>

                                <option value="1">1</option>

                                <option value="2">2</option>

                                <option value="3">3</option>

                                <option value="4">4</option>

                                <option value="5">5</option>

                                <option value="20">6+</option>

                            </select>

                        </p>

    </li>

    <li>

     

                        <input type="submit" value="Search Properties" class="searchbtn" />

    </li>

                    </form>

                }

    <!--search ends here-->

     

    Results and Results Paging Code:

    <!--results view code starts here-->


        

    @{

                try

                {

                    if (!string.IsNullOrEmpty(Request.QueryString["category"]))

                    {


                        var catogory =  Request.QueryString["category"];

                        var location = Request.QueryString["location"];

                        var postcode = Request.QueryString["postcode"];

                        var propertyType = Request.QueryString["propertyType"];

    var underOffer = Request.QueryString["underOffer"];


                        int roomsMin = Int32.Parse(Request.QueryString["roomsMin"]);

                        int roomsMax = Int32.Parse(Request.QueryString["roomsMax"]);

                        int priceMin = Int32.Parse(Request.QueryString["priceMin"]);

                        int priceMax = Int32.Parse(Request.QueryString["priceMax"]);


                        //Pull out  the property index set that we defined in the examine config

                        var Searcher = Examine.ExamineManager.Instance.SearchProviderCollection["PropertySearcher"];


                        //Setup search criteria

                        var searchCriteria = Searcher.CreateSearchCriteria(Examine.SearchCriteria.BooleanOperation.Or);


                        //build the query

                        var query = searchCriteria.Field("propertyType", propertyType);

                        if (postcode != string.Empty) { query.And().Field("postcode", postcode); }

                        if (propertyType != string.Empty) { query.And().Field("propertyType", propertyType); }

                        if (location != string.Empty) { query.And().Field("location", location); }

                        if (priceMin != null && priceMax != null) { query.And().Range("rentPcm", priceMin, priceMax, true, true); }

                        if (roomsMin != null && roomsMax != null) { query.And().Range("numberOfBedrooms", roomsMin, roomsMax, true, true); }

    if (underOffer == null) {query.And().Field("underOffer", "0");}

                        query.And().Field("nodeTypeAlias", catogory);


                        //Execute the query and populate the dataset

                        var results = Searcher.Search(query.Compile());


                        //paging starts here

                        int currentPage = 1;

                        if (Request.QueryString["page"] != null)

                        {

                            currentPage = Int32.Parse(Request.QueryString["page"]);

                        }

                        

                        //TOTAL ITEMS TO DISPLAY PER PAGE

                        int itemsPerPage = 6;

                        int totalItems = results.Count();

                        int totalPages = (int)Math.Ceiling((double)totalItems / (double)itemsPerPage);


                        if (currentPage > totalPages) { currentPage = totalPages; }

                        else if (currentPage < 1) { currentPage = 1; }


                        if (results.Count() > 0)

                        {

                            <h2>@results.Count() Properties found - Please find your Results Below</h2>

                            <ul>

                                @foreach (var x in results.Skip((currentPage - 1) * itemsPerPage).Take(itemsPerPage))

                                {

                                    var thisNode = Umbraco.TypedContent(x.Id);

                                    <li>

                                        @if (@thisNode.GetProperty("featuredImage").Value != null)

                                        {

                                            <figure><a href="@umbraco.library.NiceUrl(x.Id)"><img src="@thisNode.GetProperty("featuredImage").Value"></a></figure>

                                        }

                                        <div class="resultstext">

                                            <h3 class="red">£@x.Fields["rentPcm"] PCM</h3>

                                            <h4>@x.Fields["nodeName"]</h4>

                                           @Umbraco.Truncate(x.Fields["fullPropertyDetails"], 125)

                                           <!--<p style="color:red">Relevence score @x.Score</p>--><br/><br/>

                                            <a href="@umbraco.library.NiceUrl(x.Id)" class="viewletprop">View Property Details</a>

                                        </div>

                                    </li>

                                }

                            </ul>


                            if (totalPages > 1)

                            {

                                <p>

                                    Page @currentPage of @totalPages

                                </p>

                <div id="resultspaging">

                                <ul class="paging">

                                    @for (int p = 1; p < totalPages + 1; p++)

                                    {

                                        string selected = (p == currentPage) ? "selected" : String.Empty;

                                        string url = "?page=" + p;

                                        if (catogory != null) { url += "&category=" + catogory; }

                                        if (location != null) { url += "&location=" + location; }

                                        if (postcode != null) { url += "&postcode=" + postcode; }

                                        if (propertyType != null) { url += "&propertyType=" + propertyType; }

                                        if (roomsMin != null) { url += "&roomsMin=" + roomsMin; }

                                        if (roomsMax != null) { url += "&roomsMax=" + roomsMax; }

                                        if (priceMin != null) { url += "&priceMin=" + priceMin; }

                                        if (priceMax != null) { url += "&priceMax=" + priceMax; }

                                        <li class="@selected"><a href="@url" title="Go to page @p of results">@p</a></li>

                                    }

                                </ul>

    </div>

                            }

                        }

                        else

                        {

                            <h3>Sorry, no results found</h3>

                            <p><a href="/residential-lettings/" class="searchagain"> Try searching again</a></p>

                        }

                    }

                }


                //Catch and display any errors. Maybe comment this before going live.

                catch (Exception ex)

                {

                    <p>@ex.ToString()</p>

                }

            }

    <!-- results view code ends here-->

     

    Config files:

     

    ExamineIndex.config:

    <?xml version="1.0"?>

    <!-- 

    Umbraco examine is an extensible indexer and search engine.

    This configuration file can be extended to create your own index sets.

    Index/Search providers can be defined in the UmbracoSettings.config


    More information and documentation can be found on CodePlex: http://umbracoexamine.codeplex.com

    -->

    <ExamineLuceneIndexSets>

      <!-- The internal index set used by Umbraco back-office - DO NOT REMOVE -->

      <IndexSet SetName="InternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/Internal/"/>


      <!-- The internal index set used by Umbraco back-office for indexing members - DO NOT REMOVE -->

      <IndexSet SetName="InternalMemberIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/InternalMember/">

        <IndexAttributeFields>

          <add Name="id" />

          <add Name="nodeName"/>

          <add Name="updateDate" />

          <add Name="writerName" />

          <add Name="loginName" />

          <add Name="email" />

          <add Name="nodeTypeAlias" />

        </IndexAttributeFields>

      </IndexSet>

        

      <!-- Default Indexset for external searches, this indexes all fields on all types of nodes-->

      <IndexSet SetName="ExternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/External/" />


    <IndexSet SetName="PropertySearch" IndexPath="~/App_Data/ExamineIndexes/PropertySearch/">

        <IndexAttributeFields>

          <add Name="id" />

          <add Name="nodeName"/>

          <add Name="updateDate" />

          <add Name="writerName" />

          <add Name="nodeTypeAlias" />

        </IndexAttributeFields>

        <IndexUserFields>

          <add Name="location"/>

          <add Name="postcode"/>

          <add Name="propertyType"/>

          <add Name="housePrice" Type="Number"/>

          <add Name="numberOfBedrooms" Type="Number"/>

          <add Name="fullPropertyDetails"/>

          <add Name="councilTaxBand"/>

          <add Name="rentPcm" Type="Number"/>

          <add Name="soldSubjectToContract" />

          <add Name="underOffer" />

        </IndexUserFields>

        <IncludeNodeTypes>

          <add Name="PropertyDetails" />

        </IncludeNodeTypes>

      </IndexSet>

     

    </ExamineLuceneIndexSets>

     

    ExamineSettings.config

     

    <?xml version="1.0"?>

    <!-- 

    Umbraco examine is an extensible indexer and search engine.

    This configuration file can be extended to add your own search/index providers.

    Index sets can be defined in the ExamineIndex.config if you're using the standard provider model.


    More information and documentation can be found on CodePlex: http://umbracoexamine.codeplex.com

    -->

    <Examine>

      <ExamineIndexProviders>

        <providers>

          <add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"

               supportUnpublished="true"

               supportProtected="true"

               analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>


          <add name="InternalMemberIndexer" type="UmbracoExamine.UmbracoMemberIndexer, UmbracoExamine"

               supportUnpublished="true"

               supportProtected="true"

               analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>


            <!-- default external indexer, which excludes protected and unpublished pages-->

            <add name="ExternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"/>


    <add name="PropertySearchIndexer"

          type="UmbracoExamine.UmbracoContentIndexer,UmbracoExamine"

          supportUnpublished="false"

          supportProtected="true"

          interval="10"

          analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"

          indexSet="PropertySearch"/>

          

        </providers>

      </ExamineIndexProviders>


      <ExamineSearchProviders defaultProvider="ExternalSearcher">

        <providers>

          <add name="InternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"

               analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>

            

          <add name="ExternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" />

          

          <add name="InternalMemberSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"

               analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcard="true"/>


    <add name="PropertySearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"

           analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" indexSet="PropertySearch" enableLeadingWildcards="true"/>



        </providers>

      </ExamineSearchProviders>


     

    </Examine>

     

     

     

     

     

     

  • Sören Deger 733 posts 2844 karma points c-trib
    Jan 06, 2015 @ 08:16
    Sören Deger
    0

    Hi Brian,

    Your indexer have the name "PropertySearchIndexer". Because of that I think your searcher in examinesettings.config must have the name "PropertySearchSearcher" instead of "PropertySearcher". 

     

    Cheers

    Sören

Please Sign in or register to post replies

Write your reply to:

Draft