I have indexed some non-english pages in solr index. From the solr admin
interface I can query using the raw unicodes like this,

\u062d\u06c2 \u0627\u0648\u0644\u202c

and this gives the resulting page correctly. Now I'm trying to do that
through java script in a web page via SolrJ for english queries it is
working fine but not for non-english content.
If I've to use the above unicoded query then how shall I proceed. I've a
method to which I pass the query which returns back the result after quering
solr. I even tried encoding the query in UTF-8 but of no use. The web page
is like this

*<FORM NAME="form">
<INPUT TYPE="TEXT" NAME="text">
<INPUT TYPE="BUTTON" VALUE="Search"
onClick="document.solrJava.setQuery(getQuery());">
</FORM>
<APPLET NAME="solrJava" CODE="solrJava.class" WIDTH=250 HEIGHT=125 MAYSCRIPT
id="talk">
</APPLET>
</body>
</html>
*
 setQuery() is part of solrJave class that just sets the query string and
getQuery() function is emebeded inside the javascript like this,

     *<script>
        function getQuery() {
            return (encodeUTF8("non-english-query"));   //my query, how to
put the unicoded query here? for any english queries its working fine.
        }
     </script>*

I tried using some encode/decode for utf-8, the functions are given below,

     *<script>
        function encodeUTF8( s ){
              return unescape( encodeURIComponent( s ) );
        }
        function decodeUTF8( s ){
              return decodeURIComponent( escape( s ) );
        }
     </script>*


 Any advice will be highly appreciated.

KK

Reply via email to