Hey guys, We're migrating from Lucene to Solr. So far the migration has been smooth, however there is one feature I'm having issues adapting. Our calls to our indexing service are defined in a central interface. Here is an example of a query executed from a programmatically constructed Lucene query.
BooleanQuery query = new BooleanQuery(); BooleanQuery inputTerms = new BooleanQuery(); inputTerms.add(new TermQuery(new Term(FIELD_EMAIL, input)), Occur.SHOULD); inputTerms.add(new TermQuery(new Term(FIELD_PHONE, getNumericString(input))), Occur.SHOULD); query.add(inputTerms, Occur.MUST); query.add(new TermQuery(new Term(FIELD_RESOLVED, String.valueOf(false))),Occur.MUST); NumericRangeQuery time = NumericRangeQuery.newLongRange(FIELD_CREATETIME, null, endTime, true, true); query.add(time, Occur.MUST); SortField sort = new SortField(FIELD_CREATETIME, SortField.LONG, true); CommonsHttpSolrServer client = getClient(indexName); SolrQuery solrQuery = new SolrQuery(); //TODO how do I set the sort? solrQuery.setQuery(query.toString()); QueryResponse response = client.query(solrQuery); How can I set the sort into the java client? Also, with the annotations of Pojo's outlined here. http://wiki.apache.org/solr/Solrj#Directly_adding_POJOs_to_Solr How are sets handled? For instance, how are Lists of other POJO's added to the document? Thanks, Todd