I have my website in two lenguages i.e English & danish
Like this....
EN
>page1
>page2
>page3
DN
>Page1
>Page2
>Page3
both are inside the same domain.
i.e. for english site i use www.xyz.com/en & for danish site i use www.xyz.com/dn
I have problems while searching ...
I have created the search control
when i search for some word it searches in both the websites & shows the results on the results page of the english site which i dont want....
(search control is usercontrol made by me)
I want that if i search in english site then results only from english site should be shown on the results page which is in side english site & if i search in danish site then results only from english site should be shown on the results page which is in side danish site.
I have my website in two lenguages i.e English & danish
Like this....
EN
>page1
>page2
>page3
DK
>Page1
>Page2
>Page3
both are inside the same domain.
i.e. for english site i use www.xyz.com/en & for danish site i use www.xyz.com/dn
I have problems while searching ...
I have created the search control
when i search for some word it searches in both the websites & shows the results on the results page of the english site which i dont want....
(search control is usercontrol made by me)
I want that if i search in english site then results only from english site should be shown on the results page which is in side english site & if i search in danish site then results only from danish site should be shown on the results page which is in side danish site.
I think i have to change the indexing but dont know wat to change ....
I also have one more problem....
When i search then always result page of the english site is shown ...but i have created result page for both english & danish sites.
Of course, also have to provide index providers and search provider in examineSettings.config. Make sure to use the naming conventions for both indexer and searcher.
<!-- 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 ************************************************--> <p> Search text: <b> <u> <xsl:value-of select="$searchTerm"/> </u> </b> <i> <b> <xsl:value-of select="count($results//node)"/> </b> result(s) </i> </p>
<xsl:if test="count($results//node) > 0">
<!-- there is a result, so show them in the order of best score -->
You need to use the examine search method with signature SearchContentOnly(string searchText, bool useWildcards, string providerName) and pass in the provider eg ENSearcher
You need to call the method examine:SearchContentOnly($searchTerm,true(),'ENSearcher') if you are doing english only search and change to DKSearcher if DK.
<xsl:variablename="results"select="umbraco.examine:SearchContentOnly($searchTerm,true(),'ENSearcher')"/>
insted of
<xsl:variablename="results"select="examine:Search($searchTerm)"/>
Lucene Search for multilingual site
Hello,
I have my website in two lenguages i.e English & danish
Like this....
EN
>page1
>page2
>page3
DN
>Page1
>Page2
>Page3
both are inside the same domain.
i.e. for english site i use www.xyz.com/en & for danish site i use www.xyz.com/dn
I have problems while searching ...
I have created the search control
when i search for some word it searches in both the websites & shows the results on the results page of the english site which i dont want....
(search control is usercontrol made by me)
I want that if i search in english site then results only from english site should be shown on the results page which is in side english site & if i search in danish site then results only from english site should be shown on the results page which is in side danish site.
Hello,
I have my website in two lenguages i.e English & danish
Like this....
EN
>page1
>page2
>page3
DK
>Page1
>Page2
>Page3
both are inside the same domain.
i.e. for english site i use www.xyz.com/en & for danish site i use www.xyz.com/dn
I have problems while searching ...
I have created the search control
when i search for some word it searches in both the websites & shows the results on the results page of the english site which i dont want....
(search control is usercontrol made by me)
I want that if i search in english site then results only from english site should be shown on the results page which is in side english site & if i search in danish site then results only from danish site should be shown on the results page which is in side danish site.
I think i have to change the indexing but dont know wat to change ....
I also have one more problem....
When i search then always result page of the english site is shown ...but i have created result page for both english & danish sites.
you could create two indexes, one for each language on your site and use the correct corresponding searcer when performing your search!
For example (in ExamineIndex.config):
Of course, also have to provide index providers and search provider in examineSettings.config. Make sure to use the naming conventions for both indexer and searcher.
Cheers,
/Dirk
I really dont know how to create different indexes for different languages.... also how to use there searcher while searching ...
right now for my english site i am using default indixing provided in umbraco ....
I have creted one usercontrol which passes the word to be searched to xslt & then xslt displays the result ....my xslt is something like this.....
I have created indexes for my two languages like this ...
also the provider & searcher are like this ...
now can any one help me for searching the data as i dont know how to use this searcher while searching ....
vaibhav,
You need to use the examine search method with signature SearchContentOnly(string searchText, bool useWildcards, string providerName) and pass in the provider eg ENSearcher
Regards
Ismail
Hi Ismail ,
Can you tell me how can i do this with xslt ..which i have posted above .... or have to do this in the cs file of the usercontrol which i am using.
In your xslt you have line
You need to call the method examine:SearchContentOnly($searchTerm,true(),'ENSearcher') if you are doing english only search and change to DKSearcher if DK.
getting error as "Error parsing XSLT file: \xslt\SearchResults.xslt" ...
may be it is not able to find method ...SearchContentOnly ....
how to solve this ....
hi,
I solved the problem ....
i just changed
after that i used this ...
thanks....Dirk & Ismail
Lucene search is not working for Chinese langauge character , can anybody help me in this ?
replied http://our.umbraco.org/forum/developers/api-questions/33788-Lucene-search-for-Chinese-language-website
is working on a reply...