[ 
https://issues.apache.org/jira/browse/SOLR-1982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12884847#action_12884847
 ] 

Hoss Man commented on SOLR-1982:
--------------------------------

The behavior comes from the fact that during initialization, 
SolrQueryParser.checkAllowLeadingWildcards calls setAllowLeadingWildcard(true); 
if any field type uses ReversedWildcardFilterFactory.

Then in getWildcardQuery, it the specific field type before calling 
ReverseStringFilter.reverse, but then, regardless of field type, delegates to 
super.getWildcardQuery which will allow the leading wildcard for *all* fields 
based on the previous call to setAllowLeadingWildcard(true).

I'm not really sure what the intention was for fields that don't use 
ReversedWildcardFilterFactory, but the current behavior makes no sense at all.  
Either leading wildcards should *only* be allowed for fieldtypes that use 
ReversedWildcardFilterFactory, or the QParser should have a config option to 
control it for other fields -- but as it stands it makes no sense what so ever.

> Leading wildcard queries work for "all" fields if 
> ReversedWildcardFilterFactory is used for "any" field
> -------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1982
>                 URL: https://issues.apache.org/jira/browse/SOLR-1982
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.4, 1.4.1
>            Reporter: Hoss Man
>
> As noted on the mailing list...
> http://search.lucidimagination.com/search/document/8064e6877f49e4c4/leading_wildcard_query_strangeness
> ...SolrQueryParse supports leading wild card queries for *any* field as long 
> as at least one field type exists in the schema.xml which uses 
> ReversedWildcardFilterFactory -- even if that field type is never used.
> This is extremely confusing, and ost likely indicates a bug in how 
> SolrQueryParser deals with ReversedWildcardFilterFactory

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to