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
    Jan 04, 2015 @ 16:37
    Brian
    0

    Examine Search Error Message

    Hi guys,

    I am attempting to implement a section of examine search code that was written for me into a new website.  I have updated the examinesettings and config files as well as ensuring all datatypes are included, but when I run the search on the front end of the website I am getting the error message below..

    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 171

    Any ideas, for info this is on version 7 and the code being used is below:

     

    @{

                    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="" id="town" name="town" />

     

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

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

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

     

                                    <option>WS15</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="View Results" class="searchbtn" />

    </li>

                    </form>

     

                }

    ExamineIndex

    <?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="PropertySearchIndexSet" IndexPath="~/App_Data/ExamineIndexes/PropertySearchIndexSet/">

        <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>

     

      </IndexSet>

     

     

    </ExamineLuceneIndexSets>

     

    Examine Settings

    <?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="PropertySearchIndexSet"/>

     

        </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="PropertySearchIndexSet" enableLeadingWildcards="true"/>

     

     

        </providers>

      </ExamineSearchProviders>

     

    </Examine>

  • Brian 77 posts 251 karma points
    Jan 04, 2015 @ 17:02
    Brian
    0

    Quick update...

    after looking through the quick start guide for examine I have amended my Searcher reference from:

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

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

    To 

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

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

    This has chanegd the error message to the following:

    System.NullReferenceException: Object reference not set to an instance of an object. at ASP._Page_Views_PropertySearch_cshtml.Execute() in c:\HostingSpaces\bmhwebdesign\letitbeproperties.com\wwwroot\Views\PropertySearch.cshtml:line 165

  • 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