cancel
Showing results for 
Search instead for 
Did you mean: 

SOLR search using 'ALL' term

valery_antonov
Champ in-the-making
Champ in-the-making
Search like "ALL:foo*" throws UnsupportedOperationException in Solr4QueryParser.java.

Ok, what should I use instead?
4 REPLIES 4

sammasue
Champ in-the-making
Champ in-the-making
Hello Valery,

Did you have any luck with it ?

It seems that the nethod which was responsible to create the query with the keyword "ALL" has been simply commented and now just throws an exception. There is no comment to say why, no Jira number, there is even no message in the exception.


protected Query createAllQuery(String queryText, AnalysisMode analysisMode, LuceneFunction luceneFunction) throws ParseException
    {
//        Set<String> all = searchParameters.getAllAttributes();
//        if ((all == null) || (all.size() == 0))
//        {
//            Collection<QName> contentAttributes = dictionaryService.getAllProperties(null);
//            BooleanQuery query = new BooleanQuery();
//            for (QName qname : contentAttributes)
//            {
//                // The super implementation will create phrase queries etc if required
//                Query part = getFieldQuery(PROPERTY_FIELD_PREFIX + qname.toString(), queryText, analysisMode, luceneFunction);
//                if (part != null)
//                {
//                    query.add(part, Occur.SHOULD);
//                }
//                else
//                {
//                    query.add(createNoMatchQuery(), Occur.SHOULD);
//                }
//            }
//            return query;
//        }
//        else
//        {
//            BooleanQuery query = new BooleanQuery();
//            for (String fieldName : all)
//            {
//                Query part = getFieldQuery(fieldName, queryText, analysisMode, luceneFunction);
//                if (part != null)
//                {
//                    query.add(part, Occur.SHOULD);
//                }
//                else
//                {
//                    query.add(createNoMatchQuery(), Occur.SHOULD);
//                }
//            }
//            return query;
//        }
        throw new UnsupportedOperationException();
    }


Cheers,
Sam

Hi Sam

I expected to have some answer from mroger, but no luck…

Thanks for having created the issue, I voted for it, I'm looking forward.