Re: SolrJ Tutorial

2011-03-03 Thread Bing Li
Dear Lance,

Could you tell me where I can find the unit tests code?

I appreciate so much for your help!

Best regards,
LB

On Sat, Jan 22, 2011 at 3:58 PM, Lance Norskog goks...@gmail.com wrote:

 The unit tests are simple and show the steps.

 Lance

 On Fri, Jan 21, 2011 at 10:41 PM, Bing Li lbl...@gmail.com wrote:
  Hi, all,
 
  In the past, I always used SolrNet to interact with Solr. It works great.
  Now, I need to use SolrJ. I think it should be easier to do that than
  SolrNet since Solr and SolrJ should be homogeneous. But I cannot find a
  tutorial that is easy to follow. No tutorials explain the SolrJ
 programming
  step by step. No complete samples are found. Could anybody offer me some
  online resources to learn SolrJ?
 
  I also noticed Solr Cell and SolrJ POJO. Do you have detailed resources
 to
  them?
 
  Thanks so much!
  LB
 



 --
 Lance Norskog
 goks...@gmail.com



Re: SolrJ Tutorial

2011-03-03 Thread Grijesh
It comes with every solr source code download directory under 

src/test

-
Thanx:
Grijesh
http://lucidimagination.com
--
View this message in context: 
http://lucene.472066.n3.nabble.com/SolrJ-Tutorial-tp2307113p2631223.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: SolrJ Tutorial

2011-01-22 Thread Bing Li
I got the solution. Attach one complete sample code I made as follows.

Thanks,
LB

package com.greatfree.Solr;

import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.client.solrj.beans.Field;

import java.net.MalformedURLException;

public class SolrJExample
{
public static void main(String[] args) throws MalformedURLException,
SolrServerException
{
SolrServer solr = new CommonsHttpSolrServer(
http://192.168.210.195:8080/solr/CategorizedHub;);

SolrQuery query = new SolrQuery();
query.setQuery(*:*);
QueryResponse rsp = solr.query(query);
SolrDocumentList docs = rsp.getResults();
System.out.println(docs.getNumFound());

try
{
SolrServer solrScore = new CommonsHttpSolrServer(
http://192.168.210.195:8080/solr/score;);
Score score = new Score();
score.id = 4;
score.type = modern;
score.name = iphone;
score.score = 97;
solrScore.addBean(score);
solrScore.commit();
}
catch (Exception e)
{
System.out.println(e.toString());
}

}
}


On Sat, Jan 22, 2011 at 3:58 PM, Lance Norskog goks...@gmail.com wrote:

 The unit tests are simple and show the steps.

 Lance

 On Fri, Jan 21, 2011 at 10:41 PM, Bing Li lbl...@gmail.com wrote:
  Hi, all,
 
  In the past, I always used SolrNet to interact with Solr. It works great.
  Now, I need to use SolrJ. I think it should be easier to do that than
  SolrNet since Solr and SolrJ should be homogeneous. But I cannot find a
  tutorial that is easy to follow. No tutorials explain the SolrJ
 programming
  step by step. No complete samples are found. Could anybody offer me some
  online resources to learn SolrJ?
 
  I also noticed Solr Cell and SolrJ POJO. Do you have detailed resources
 to
  them?
 
  Thanks so much!
  LB
 



 --
 Lance Norskog
 goks...@gmail.com



SolrJ Tutorial

2011-01-21 Thread Bing Li
Hi, all,

In the past, I always used SolrNet to interact with Solr. It works great.
Now, I need to use SolrJ. I think it should be easier to do that than
SolrNet since Solr and SolrJ should be homogeneous. But I cannot find a
tutorial that is easy to follow. No tutorials explain the SolrJ programming
step by step. No complete samples are found. Could anybody offer me some
online resources to learn SolrJ?

I also noticed Solr Cell and SolrJ POJO. Do you have detailed resources to
them?

Thanks so much!
LB


Re: SolrJ Tutorial

2011-01-21 Thread Lance Norskog
The unit tests are simple and show the steps.

Lance

On Fri, Jan 21, 2011 at 10:41 PM, Bing Li lbl...@gmail.com wrote:
 Hi, all,

 In the past, I always used SolrNet to interact with Solr. It works great.
 Now, I need to use SolrJ. I think it should be easier to do that than
 SolrNet since Solr and SolrJ should be homogeneous. But I cannot find a
 tutorial that is easy to follow. No tutorials explain the SolrJ programming
 step by step. No complete samples are found. Could anybody offer me some
 online resources to learn SolrJ?

 I also noticed Solr Cell and SolrJ POJO. Do you have detailed resources to
 them?

 Thanks so much!
 LB




-- 
Lance Norskog
goks...@gmail.com