package uk.ac.ebi.quickgo.annotation.search;

import uk.ac.ebi.quickgo.rest.search.query.FieldQuery;
import uk.ac.ebi.quickgo.rest.search.query.QueryRequest;
import uk.ac.ebi.quickgo.rest.search.query.SolrQueryConverter;

import org.apache.solr.client.solrj.SolrQuery;

/**
 * @author Tony Wardell
 * Date: 28/04/2016
 * Time: 13:20
 * Created with IntelliJ IDEA.
 */
public class AnnotationSolrQueryConverter extends SolrQueryConverter{

    public AnnotationSolrQueryConverter(String requestHandler) {
        super(requestHandler);
    }

    @Override public String visit(FieldQuery query) {
        return "(" + query.field() + SOLR_FIELD_SEPARATOR + query.value() + ")";
    }

    /**
     * For annotation filtering (and we use fq only for annotations) don't set a query String
     * @param request
     * @param solrQuery
     */
    protected void assignQuery(QueryRequest request, SolrQuery solrQuery) {
        return;
    }


}

@@ -267,16 +267,127 @@
 y;%0A%0A/**%0A
+ *%0A * Specialized SolrQueryConverter. Doesn't assign a parameter to query (q) on%0A * the SolrQuery instance.%0A *%0A
  * @auth
@@ -650,149 +650,8 @@
  %7D%0A%0A
-    @Override public String visit(FieldQuery query) %7B%0A        return %22(%22 + query.field() + SOLR_FIELD_SEPARATOR + query.value() + %22)%22;%0A    %7D%0A
 %0A   

Add javadoc. Override of visit method no longer required.