Copied to clipboard

Flag this post as spam?

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


  • Manish 373 posts 932 karma points
    Jan 30, 2013 @ 07:17
    Manish
    0

    Exclude Node Type is not working (Razor Search)

    I have a node in XML with the name "productPageTitle" and I dont want this node to be a part of search result.

    <ExcludeNodeTypes>
          <add Name="titleProperties"/>
        </ExcludeNodeTypes>

    So I used <ExcludeNodeType> but still as a part of result.

    How can I exclude this node from search results?

  • Fuji Kusaka 2203 posts 4220 karma points
    Jan 30, 2013 @ 07:38
    Fuji Kusaka
    0

    Hi Manish,

    In your razor script did you reference this property alias ?

    Also have try using lucence to see the words being indexed ?

     

  • Manish 373 posts 932 karma points
    Jan 30, 2013 @ 09:09
    Manish
    0

    In your razor script did you reference this property alias ? -- where to refrence 

    I just added in ExamineIndex.config file

    As

        <IndexSet SetName="RazorSiteIndexSet"

                  IndexPath="~/App_Data/TEMP/ExamineIndexes/RazorSite/" />

      <ExcludeNodeTypes>

        <add Name="productPageTitle" />

      <ExcludeNodeTypes />

        <IndexSet SetName="ExternalIndexSet"

                  IndexPath="~/App_Data/TEMP/ExamineIndexes/External/" />

    </ExamineLuceneIndexSets>

    where   <add Name="productPageTitle" /> is alias of generic property.

     

     


  • Manish 373 posts 932 karma points
    Jan 30, 2013 @ 09:11
    Manish
    0

    Please response in detail so i can get it 

  • Manish 373 posts 932 karma points
    Jan 30, 2013 @ 09:35
    Manish
    0

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

        <IndexSet SetName="RazorSiteIndexSet"

                  IndexPath="~/App_Data/TEMP/ExamineIndexes/RazorSite/" />

      <ExcludeNodeTypes>

        <add Name="productPageTitle" />

      </ExcludeNodeTypes>

        <IndexSet SetName="ExternalIndexSet"

                  IndexPath="~/App_Data/TEMP/ExamineIndexes/External/" />

    But this is giving me error of cshtml.
  • antao 81 posts 371 karma points
    Jan 30, 2013 @ 12:24
    antao
    0

    Hey Manish, what is the specific error in the .cshtml? 

    You can use Luke (http://code.google.com/p/luke/) to check what is being indexed with Lucene.

     

    Also, I would not get or filter data in the razor view.

  • Manish 373 posts 932 karma points
    Jan 30, 2013 @ 13:28
    Manish
    0

    all works fine if i use 

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

        <IndexSet SetName="RazorSiteIndexSet"

                  IndexPath="~/App_Data/TEMP/ExamineIndexes/RazorSite/" />

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

      

    </ExamineLuceneIndexSets>

     

    but if add this 

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

          <add Name="productPageTitle" />

        </IndexAttributeFields>

        <IndexUserFields />

        <IncludeNodeTypes />

        <ExcludeNodeTypes />

      </IndexSet>

     

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

      <IndexSet SetName="RazorSiteIndexSet"

                IndexPath="~/App_Data/TEMP/ExamineIndexes/RazorSite/" />

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

      </>

     

    gies me error ::Error loading Razor Script SearchFilter.cshtml

     

    but in case of first it also display the result if the search key is the part of page title and i don't want to add if search key exists in page title.

  • Kelsee Ishmael 71 posts 158 karma points
    Feb 18, 2015 @ 22:25
    Kelsee Ishmael
    0

    This is an old post..but I believe the problem is that you are closing the index set before setting it's properties

    <IndexSet SetName="RazorSiteIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/RazorSite/" />
       <ExcludeNodeTypes>
          <add Name="productPageTitle" />
       <ExcludeNodeTypes />
    <IndexSet SetName="ExternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/External/" />
    

    The above should instead be:

    <IndexSet SetName="RazorSiteIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/RazorSite/">
       <ExcludeNodeTypes>
          <add Name="productPageTitle" />
       <ExcludeNodeTypes />
    </IndexSet>
    <IndexSet SetName="ExternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/External/" />
    
Please Sign in or register to post replies

Write your reply to:

Draft