Skip to content

Commit

Permalink
Clean SolrJ example
Browse files Browse the repository at this point in the history
  • Loading branch information
rzezeski committed Oct 17, 2012
1 parent b471d23 commit 9654845
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions priv/java/com/basho/yokozuna/query/SimpleQueryExample.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,22 +30,12 @@ public static void main(String[] args) throws SolrServerException {
String field = args[2]; String field = args[2];
String term = args[3]; String term = args[3];


SolrServer solr = new HttpSolrServer(baseURL); SolrServer solr = new HttpSolrServer(baseURL + "/" + index);
ModifiableSolrParams params = new ModifiableSolrParams(); ModifiableSolrParams params = new ModifiableSolrParams();

params.set("qt", "/");
// I'm not sure it using 'qt' is cheating but I couldn't get
// 'req.setPath' to work.
params.set("qt", "/" + index);
params.set("q", field + ":" + term); params.set("q", field + ":" + term);
SolrRequest req = new QueryRequest(params); SolrRequest req = new QueryRequest(params);


// Currently Yokozuna doesn't support the canonical Solr url,
// i.e. 'solr/<core>/select?...' but instead uses
// 'search/<index>/?...'
//
// TODO: this didn't work
// req.setPath("/" + index);

QueryResponse resp = solr.query(params); QueryResponse resp = solr.query(params);
System.out.println("resp: " + resp); System.out.println("resp: " + resp);
} }
Expand Down

0 comments on commit 9654845

Please sign in to comment.