Copied to clipboard

Flag this post as spam?

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


  • vaibhav 119 posts 139 karma points
    Jul 14, 2011 @ 09:25
    vaibhav
    0

    Lucene search indexing

    Hello,

    I have my website in 2 languages .... one id english & other is danish....

    I have created both inside the Content like this....

    Content

        >>English

        >>Danish

    I have created one usercontrol for search in english site .... which searches the content in whole website.....

    but the problem is that it also seaches the content from the danish site ...

    is there any way to saperate the indexing for both the sites.....??....

     

     

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 14, 2011 @ 10:55
    Ismail Mayat
    0

    have you applied host names at the top level of each site to identify country? if so then if you are using umbraco examine for indexing you could implement the gathering node method and for the current node pick up the root parent and get the host name setting and from there get country code and inject that code into the lucene index.  When you do the search you can filter for that.  Alternatively you could create 2 indexes one for english site and one for danish then depending on which site you are in search on that index.

     

    Regards

    Ismail

  • vaibhav 119 posts 139 karma points
    Jul 14, 2011 @ 12:33
    vaibhav
    0

    hi,

    I really dident understood what you said ....can you please explain it in some eay way.....my english site will be in ".com" domain & other will be in ".dk" .....

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 14, 2011 @ 12:43
    Ismail Mayat
    0

    what version of umbraco are you using if >=4.5 then you will be using umbraco examine if thats the case then create 2 indexes one for uk and one for dk then depending on which site you are in use that countries index.

    Regards

    Ismail

  • vaibhav 119 posts 139 karma points
    Jul 14, 2011 @ 13:03
    vaibhav
    0

    Thanx for quick reply,

    I am using umbraco 4.5 .

    I dont know how to create different indexes like you said.

    right now i am using default indexing for the umbraco.

    I just pass the word written in the searchbox through querystring ....& in my search xslt i take that word & apply it to ...this function....

          <xsl:variable name="results" select="examine:Search($searchTerm)"/>

    & i show the results......

    How to do the way you are saying....

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 14, 2011 @ 13:17
    Ismail Mayat
    0

    vaibhav,

    please refer to http://examine.codeplex.com/ for documentation of how to create indexes.  In the xslt you are using extension method is that from uComponents?

    Regards

    Ismail

  • vaibhav 119 posts 139 karma points
    Jul 15, 2011 @ 08:58
    vaibhav
    0

    The querystring just comes from the user control made for search....it goes to xslt ...here is my xslt....

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
      <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:examine="urn:examine"
      xmlns:umbraco.library="urn:umbraco.library"
      xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon"
      xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes"
      xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath"
      xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions"
      xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings"
      xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
      exclude-result-prefixes="msxml examine umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">


      <xsl:output method="xml" omit-xml-declaration="yes"/>

      <xsl:param name="currentPage"/>

      <!-- Get the search term from the query string-->
      <xsl:variable name="searchTerm" select="umbraco.library:RequestQueryString('s')" />

      <xsl:template match="/">

        <!-- Check if there's a search term to search on-->
        <xsl:if test="string-length($searchTerm) > 0">

          
          <!-- Get the search results from examine -->
          <!--************************ THIS IS WHERE THE MAGIC HAPPENS *****************************-->
                
          <xsl:variable name="results" select="examine:Search($searchTerm)"/>

          <!--************************ END OF MAGIC ************************************************-->
          
         

    i am really not familier with uComponents....

Please Sign in or register to post replies

Write your reply to:

Draft