lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bsr <>
Subject Solt with no text search
Date Sat, 24 Feb 2018 13:13:53 GMT
down vote

I have successfuly implemented the custom search in solr by extending
CustomScoreProvider. But the problem is i need to pass some user info like
31,1 which i need in custom sort.


and it is acting as a text search. Is there any way that i can skip this
text search and can just pass the user info.

some code.

public class MyCustomParserPlugin extends QParserPlugin {

    public QParser createParser(String querystring, SolrParams slocParams,
SolrParams params, SolrQueryRequest req) {
        return new MyCustomParser(querystring, slocParams, params, req);        

    private static class MyCustomParser extends QParser{

        private Query inQuery;

        public MyCustomParser(String querystring, SolrParams slocParams,
SolrParams params, SolrQueryRequest req) {
            super(querystring, slocParams, params, req);
            try {
                QParser parser = getParser(querystring, getReq());
                this.inQuery = parser.parse();
            }catch(SyntaxError ex) {
                throw new RuntimeException("error parsing query", ex);

        public Query parse() throws SyntaxError {
            return new MatchingQuery(inQuery);




public class MatchingQuery extends CustomScoreQuery {

    private Query subQuery;

    public MatchingQuery(Query subQuery) {
        this.subQuery = subQuery;

    protected CustomScoreProvider getCustomScoreProvider(LeafReaderContext
context) {
        return new MyCustomSortClz(subQuery, context);


public class MyCustomSortClz extends CustomScoreProvider {

  // ---> my sort

Sent from:

View raw message