lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "SolrGlassfish" by knaak
Date Tue, 25 May 2010 16:00:52 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "SolrGlassfish" page has been changed by knaak.
The comment on this change is: initial commit.
http://wiki.apache.org/solr/SolrGlassfish?action=diff&rev1=1&rev2=2

--------------------------------------------------

  
  Look for Enterprise Service on the left hand side and click on it.  Look for "System Properties"
tab along the top, click on it.  Here you will setup your Solr home and data directories.
 Click on "Add Property" and in the name field put:
  
- ''solr.solr.home'' and in the value put the fully qualified path to your solr folder.  Example
in Linux would be /opt/solr. 
+ ''solr.solr.home'' and in the value put the fully qualified path to your solr folder.  Example
in Linux would be ''/opt/solr''. 
  
- ''solr.data.dir'' and add the location of your data directory, an example might be /var/solrdata/
+ ''solr.data.dir'' and add the location of your data directory, an example might be ''/var/solrdata/''
 You will need to ensure that the permissions are set here, consult Solr installation documentation
for assistance.
  
  Then click on "Save" button in the upper right hand corner.  I then restarted my Glassfish
server to ensure the properties were set by clicking on the "General" tab and then "Restart".
  
  Once this is done, you may deploy the war.  For apache-solr-1.4.0, you should copy apache-solr-1.4.0/dist/apache-solr-1.4.0.war
to your $GLASSFISHHOME/glassfishv3/domains/''domainname''/autodeploy.  You can then verify
that Solr deployed by going to that folder and you should see apache-solr-1.4.0.war.deployed.
  
- Check the logs directory ($GLASSFISHHOME/glassfishv3/domains/''domainname''/logs) and you
should see the Solr start up including it finding the solr.solr.hom and solr.data.dir parameters.
 Goto http://'servername':8080/apache-solr-1.4.0/  to confirm successful installation.
+ Check the logs directory ($GLASSFISHHOME/glassfishv3/domains/''domainname''/logs) and you
should see the Solr start up including it finding the solr.solr.home and solr.data.dir parameters.
 Goto http://'servername':8080/apache-solr-1.4.0/  to confirm successful installation.
  
+ 
+ == Glassfish and UTF-8 ==
+ 
+ Solr and Glassfish appear to have a problem similar to Tomcat with UTF-8 and using GET to
make thee requests.  Glassfish accepts the URL to contain UTF-8, but seems to fail with the
query parameters.  This is how I handled this problem, I am sure there is a better way.  Here
is how the problem shows itself:
+ 
+ Goto to http://localhost:8080/apache-solr-1.4.0/admin/form.jsp and search for num'''é'''ro.
 Then check the glassfish server.log and you will see:
+ 
+ {{{INFO: [] webapp=/apache-solr-1.4.0 path=/select params={indent=on&version=2.2&q=numéro&fq=&start=0&rows=10&fl=*,score&qt=standard&wt=standard&explainOther=&hl.fl=}
hits=0 status=0 QTime=16}}}
+ 
+ Note how Glassfish handled the encoding, it converted the single double-byte to two single-bytes.
+ 
+ I happen to be using Solrj for my application, and so my solution was to switch to POST
rather than GET.  I did this here:
+ 
+ {{{
+             return server.query(new solrQuery().setQuery(query), METHOD.POST);
+ }}}
+ 
+ Note the '''METHOD.POST''' which obviously POSTs the data as parameters which Glassfish
does seem to support.  That bypasses the issue of running a non-Embedded Solr instance on
Glassfish with UTF-8 queries under Solrj.
+ 

Mime
View raw message