Try complexphrasequeryparser. If (and only if) you always want to search from the beginning of the content, you might be able to use string rather than text-based Fields but make sure to escape whitespace...
Best, Erick On Sat, Mar 30, 2019, 10:33 ahemad.sh...@yahoo.com.INVALID <ahemad.sh...@yahoo.com.invalid> wrote: > Hi , > I have field with white spaces and special characters on which indexing > needs to be done to do wildcard querying. > It works for most of the scnearios with wildcard search. > e.g. if my data is "ali.abc" and "abc_pqr" and "ali abc" and "ahemad ali" > then search with ali* gives this three results. > > But I am not able to search with say - ali a* > > Search with query q="ali abc" gives exact match and desired result. > > I want to do wildcard search where criteria can include spaces like > example - "ahemad a* or ahemad a* > > > i.e. if space is present then I am not able to to wildcard search. > > Is there any way by which wildcard search will be achieved even if space > is present in token. > > The field type have is below: > > <fieldType name="string_rev"class="solr.TextField" > sortMissingLast="true"> > > <analyzer type="index"> > > <tokenizerclass="solr.KeywordTokenizerFactory"/> > > <filterclass="solr.LowerCaseFilterFactory" /> > > <filterclass="solr.PatternReplaceFilterFactory"pattern="[\s+]" > replacement=""replace="all" /> > > <filterclass="solr.ReversedWildcardFilterFactory" /> > > </analyzer> > > <analyzer type="query"> > > <tokenizerclass="solr.KeywordTokenizerFactory"/> > > <filterclass="solr.LowerCaseFilterFactory" /> > > <filterclass="solr.PatternReplaceFilterFactory"pattern="[\s+]" > replacement=""replace="all" /> > > </analyzer> > > </fieldType> > Any help would be great. > Thanks,Ahemad Ali