Buggy code:
public AlfrescoSolrDataModel . IndexedField getIndexedFieldForContentPropertyMetadata ( QName propertyQName , AlfrescoSolrDataModel . ContentFieldType type ) { } public AlfrescoSolrDataModel . IndexedField getQueryableFields ( QName propertyQName , AlfrescoSolrDataModel . ContentFieldType type , AlfrescoSolrDataModel . FieldUse fieldUse ) { } private void addCompletionFields ( PropertyDefinition propertyDefinition , AlfrescoSolrDataModel . IndexedField indexedField ) { } private void addFullTextSearchFields ( PropertyDefinition propertyDefinition , AlfrescoSolrDataModel . IndexedField indexedField ) { } private void addIdentifierSearchFields ( PropertyDefinition propertyDefinition , AlfrescoSolrDataModel . IndexedField indexedField ) { } private void addFacetSearchFields ( PropertyDefinition propertyDefinition , AlfrescoSolrDataModel . IndexedField indexedField ) { } private void addMultiSearchFields ( PropertyDefinition propertyDefinition , AlfrescoSolrDataModel . IndexedField indexedField ) { } private void addStatsSearchFields ( PropertyDefinition propertyDefinition , AlfrescoSolrDataModel . IndexedField indexedField ) { } private void addSortSearchFields ( PropertyDefinition propertyDefinition , AlfrescoSolrDataModel . IndexedField indexedField ) { } public AlfrescoSolrDataModel . IndexedField getIndexedFieldNamesForProperty ( QName propertyQName ) { } private boolean isIdentifierTextProperty ( QName propertyQName ) { } private boolean isTextField ( PropertyDefinition propertyDefinition ) { } private boolean isSuggestable ( QName propertyQName ) { } private boolean hasDocValues ( PropertyDefinition propertyDefinition ) { } private boolean isPrimitive ( DataTypeDefinition dataType ) { } private String getFieldForNonText ( PropertyDefinition propertyDefinition ) { } private String getFieldForText ( boolean localised , boolean tokenised , boolean sort , PropertyDefinition propertyDefinition ) { } private PropertyDefinition getPropertyDefinition ( String fieldName ) { } public PropertyDefinition getPropertyDefinition ( QName propertyQName ) { } private String expandFieldName ( String fieldName ) { } private String expandAttributeFieldName ( String field ) { } public boolean putModel ( M2Model model ) { } private Set < String > validateModel ( M2Model model ) { } public M2Model getM2Model ( QName modelQName ) { } public void afterInitModels ( ) { } public Query parseCMISQueryToAlfrescoAbstractQuery ( CMISQueryMode mode , SearchParameters searchParameters , SolrQueryRequest req , String alternativeDictionary , CmisVersion cmisVersion ) { } public CmisFunctionEvaluationContext getCMISFunctionEvaluationContext ( CMISQueryMode mode , CmisVersion cmisVersion , String alternativeDictionary ) { } public CMISDictionaryService getCMISDictionary ( String alternativeDictionary , CmisVersion cmisVersion ) { } public static final class TermOrdValComparator extends FieldComparator < BytesRef > { final int [ ] ords ; final BytesRef [ ] values ; final int [ ] readerGen ; int currentReaderGen = - 1 ; SortedDocValues termsIndex ; private final String field ; int bottomSlot = - 1 ; int bottomOrd ; boolean bottomSameReader ; BytesRef bottomValue ; BytesRef topValue ; boolean topSameReader ; int topOrd ; private int docBase ; final BytesRef tempBR = new BytesRef ( ) ; final int missingSortCmp ; final int missingOrd ; public TermOrdValComparator ( int numHits , String field ) { } public TermOrdValComparator ( int numHits , String field , boolean sortMissingLast ) { } @ Override public int compare ( int slot1 , int slot2 ) { } @ Override public int compareBottom ( int doc ) { } @ Override public void copy ( int slot , int doc ) { } @ Override public FieldComparator < BytesRef > setNextReader ( AtomicReaderContext context ) throws IOException { } @ Override public void setBottom ( final int bottom ) { } @ Override public void setTopValue ( BytesRef value ) { } @ Override public BytesRef value ( int slot ) { } @ Override public int compareTop ( int doc ) { } @ Override public int compareValues ( BytesRef val1 , BytesRef val2 ) { } } public void setAlfrescoFieldType ( AlfrescoFieldType alfrescoFieldType ) { } public List < AlfrescoModel > getAlfrescoModels ( ) { } public Map < String , Set < String > > getModelErrors ( ) { } public static class IndexedField { private List < AlfrescoSolrDataModel . FieldInstance > fields = new LinkedList < > ( ) ; public IndexedField ( ) { } public IndexedField ( String prefix , boolean localised , boolean sort ) { } public List < AlfrescoSolrDataModel . FieldInstance > getFields ( ) { } public void addField ( String prefix , boolean localised , boolean sort ) { } } public static class FieldInstance { String field ; boolean localised ; boolean sort ; public FieldInstance ( String field , boolean localised , boolean sort ) { } public String getField ( ) { } public boolean isLocalised ( ) { } public boolean isSort ( ) { } } public Query getCMISQuery ( CMISQueryMode mode , Pair < SearchParameters , Boolean > searchParametersAndFilter , SolrQueryRequest req , org . alfresco . repo . search . impl . querymodel . Query queryModelQuery , CmisVersion cmisVersion , String alternativeDictionary ) throws ParseException { } public LuceneQueryBuilderContext < Query , Sort , ParseException > getLuceneQueryBuilderContext ( SearchParameters searchParameters , SolrQueryRequest req , String alternativeDictionary ) { } public Solr4QueryParser getLuceneQueryParser ( SearchParameters searchParameters , SolrQueryRequest req ) { <START_BUG> Analyzer analyzer = req . getSchema ( ) . getAnalyzer ( ) ; <END_BUG> Solr4QueryParser parser = new Solr4QueryParser ( req . getSchema ( ) , Version . LUCENE_48 , searchParameters . getDefaultFieldName ( ) , analyzer ) ; parser . setNamespacePrefixResolver ( namespaceDAO ) ; parser . setDictionaryService ( getDictionaryService ( DEFAULT ) ) ; parser . setTenantService ( tenantService ) ; parser . setSearchParameters ( searchParameters ) ; parser . setAllowLeadingWildcard ( true ) ; Properties props = new org . apache . solr . core . CoreDescriptorDecorator ( req . getCore ( ) . getCoreDescriptor ( ) ) . getCoreProperties ( ) ; int topTermSpanRewriteLimit = Integer . parseInt ( props . getProperty ( "alfresco.topTermSpanRewriteLimit" , "1000" ) ) ; parser . setTopTermSpanRewriteLimit ( topTermSpanRewriteLimit ) ; return parser ; } public Query getFTSQuery ( Pair < SearchParameters , Boolean > searchParametersAndFilter , SolrQueryRequest req ) throws ParseException { } public String mapProperty ( String potentialProperty , AlfrescoSolrDataModel . FieldUse fieldUse , SolrQueryRequest req ) { } public String mapNonPropertyFields ( String queryField ) { } public AlfrescoSolrDataModel . ContentFieldType getTextField ( String ending ) { } public void setCMDefaultUri ( ) { } }

Fix:
Analyzer analyzer = req . getSchema ( ) . getQueryAnalyzer ( ) ;