Permalink
Browse files

Clean SolrJ example

  • Loading branch information...
1 parent b471d23 commit 96548458ea0a5f8e45622d9504f681f67edca0aa @rzezeski committed Oct 17, 2012
Showing with 2 additions and 12 deletions.
  1. +2 −12 priv/java/com/basho/yokozuna/query/SimpleQueryExample.java
@@ -30,22 +30,12 @@ public static void main(String[] args) throws SolrServerException {
String field = args[2];
String term = args[3];
- SolrServer solr = new HttpSolrServer(baseURL);
+ SolrServer solr = new HttpSolrServer(baseURL + "/" + index);
ModifiableSolrParams params = new ModifiableSolrParams();
-
- // I'm not sure it using 'qt' is cheating but I couldn't get
- // 'req.setPath' to work.
- params.set("qt", "/" + index);
+ params.set("qt", "/");
params.set("q", field + ":" + term);
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);
System.out.println("resp: " + resp);
}

0 comments on commit 9654845

Please sign in to comment.